MCPcopy Create free account
hub / github.com/davy7125/polyphone / Player

Method Player

sources/player/player.cpp:36–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34QList<Player *> Player::s_instances;
35
36Player::Player(PlayerOptions * playerOptions, QWidget * parent) : SoundfontTab(parent),
37 ui(new Ui::Player),
38 _playerOptions(new PlayerOptions(playerOptions)),
39 _synth(ContextManager::audio()->getSynth()),
40 _initializing(true)
41{
42 memset(_currentKeyVelocities, 0, 128 * sizeof(int));
43 ui->setupUi(this);
44
45 ui->listPreset->setItemDelegate(new PlayerPresetListDelegate(ui->listPreset));
46 QString highlightColorBackground = ContextManager::theme()->getColor(ThemeManager::HIGHLIGHTED_BACKGROUND).name();
47 QString highlightColorText = ContextManager::theme()->getColor(ThemeManager::HIGHLIGHTED_TEXT).name();
48 ui->topBar->setStyleSheet("QWidget#topBar{background-color:" + highlightColorBackground + "} QLabel{color:" + highlightColorText + "}");
49
50 ui->pushPanic->initialize(tr("MIDI panic"), ":/icons/MIDI_panic.svg");
51 ui->pushShowRecorder->initialize(tr("Recorder"), ":/icons/recorder.svg");
52 ui->pushShowRecorder->setChecked(s_recorderOpen);
53
54 // Keyboard with all keys (128)
55 ui->keyboard->set(PianoKeybd::PROPERTY_KEY_MIN, 0);
56 ui->keyboard->set(PianoKeybd::PROPERTY_KEY_NUMBER, 128);
57
58 // Initialize the configuration
59 ui->comboChannel->setCurrentIndex(_playerOptions->playerChannel() + 1);
60 ui->comboMultipleSelection->setCurrentIndex(_playerOptions->playerMultipleSelection() ? 1 : 0);
61 ui->comboSelectionByKeys->setCurrentIndex(_playerOptions->playerKeySelection());
62
63 s_instances << this;
64}
65
66Player::~Player()
67{

Callers

nothing calls this directly

Calls 7

getSynthMethod · 0.80
playerChannelMethod · 0.80
playerKeySelectionMethod · 0.80
getColorMethod · 0.45
initializeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected