| 34 | QList<Player *> Player::s_instances; |
| 35 | |
| 36 | Player::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 | |
| 66 | Player::~Player() |
| 67 | { |
nothing calls this directly
no test coverage detected