CSequenserForm::CSequenserForm(IDevice* Device, QWidget *parent) : CSoftSynthsForm(Device,true,parent), ui(new Ui::CSequenserForm) { ui->setupUi(this); PlayListMenu=new QMenu(this); PlayListMenu->addAction("Add...",this,SLOT(MenuAddPatternClick())); PlayListMenu->addAction("Remove",this,SLOT(MenuRemovePatternClick())); PlayListMenu->addAction("Edit...",this,SLOT(MenuEditPatternClick())); connect(ui->AddPattern,SIGNAL(clicked()),this,SLOT(AddPatternClick())); connect(ui->RemovePattern,SIGNAL(clicked()),this,SLOT(RemovePatternClick())); connect(ui->NameEdit,SIGNAL(textEdited(QString)),this,SLOT(ChangeName())); connect(ui->TempoSpin,SIGNAL(valueChanged(int)),this,SLOT(ChangeTempo(int))); connect(ui->BeatsSpin,SIGNAL(valueChanged(int)),this,SLOT(ChangeNumOfBeats(int))); connect(ui->PatternList,SIGNAL(currentRowChanged(int)),this,SLOT(ChangePatternIndex())); connect(ui->PatternPlayList,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(PlayListPopup(QPoint))); connect(ui->PatternPlayList,SIGNAL(currentRowChanged(int)),this,SLOT(ChangeListIndex(int))); UpdatePatterns(); UpdateBeats(); UpdatePatternlist(); }
void CSequenserForm::AddPatternClick() { CSequenser* m_DM=(CSequenser*)m_Device; PatternType* P=new PatternType("New Pattern",16,1,100,0,0); m_DM->Patterns.append(P); UpdatePatterns(); ui->PatternList->setCurrentRow(ui->PatternList->count()-1); //TabControl1->TabIndex=m_DM->Patterns->Count-1; //TabControl1->OnChange(this); }
void CSequenserForm::RemovePatternClick() { if (ui->PatternList->count()>0) { int Curr=ui->PatternList->currentRow(); RemovePattern(Curr); UpdatePatterns(); if (Curr>ui->PatternList->count()-1) { ui->PatternList->setCurrentRow(ui->PatternList->count()-1); } else { ui->PatternList->setCurrentRow(Curr); } } }
ECode CSplitClockView::OnAttachedToWindow() { LinearLayout::OnAttachedToWindow(); AutoPtr<IIntentFilter> filter; CIntentFilter::New((IIntentFilter**)&filter); filter->AddAction(IIntent::ACTION_TIME_CHANGED); filter->AddAction(IIntent::ACTION_TIMEZONE_CHANGED); filter->AddAction(IIntent::ACTION_LOCALE_CHANGED); AutoPtr<IContext> context; GetContext((IContext**)&context); AutoPtr<IIntent> i; context->RegisterReceiver(mIntentReceiver, filter, String(NULL), NULL, (IIntent**)&i); UpdatePatterns(); return NOERROR; }
/* void CSequenserForm::FormResize(TObject *Sender) { ListView1->Columns->Items[0]->Width=ListView1->ClientWidth; } */ void CSequenserForm::ChangeName() { CSequenser* m_DM=(CSequenser*)m_Device; m_DM->Patterns[ui->PatternList->currentRow()]->Name=ui->NameEdit->text(); UpdatePatterns(); }