コード例 #1
0
void
JXFSBindingTable::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (sender == itsAddButton && message.Is(JXButton::kPushed))
		{
		AddPattern();
		}
	else if (sender == itsRemoveButton && message.Is(JXButton::kPushed))
		{
		RemovePattern();
		}
	else if (sender == itsDuplicateButton && message.Is(JXButton::kPushed))
		{
		DuplicatePattern();
		}

	else if (sender == itsTypeMenu && message.Is(JXMenu::kNeedsUpdate))
		{
		UpdateTypeMenu();
		}
	else if (sender == itsTypeMenu && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast(const JXMenu::ItemSelected*, &message);
		assert( selection != NULL );
		HandleTypeMenu(selection->GetIndex());
		}

	else
		{
		if (sender == &(GetTableSelection()))
コード例 #2
0
void CSequenserForm::CustomLoad(const QString &XML)
{
    CSequenser* m_DM=(CSequenser*)m_Device;
    for (int i=m_DM->Patterns.count()-1;i>-1;i--)
    {
        RemovePattern(i);
    }
    m_DM->Patterns.clear();
    m_DM->PatternsInList.clear();
    QDomLiteElement xml;
    xml.fromString(XML);
    if (xml.tag=="Custom")
    {
        QDomLiteElementList XMLPatterns=xml.elementsByTag("Pattern");
        foreach (QDomLiteElement* Pattern, XMLPatterns)
        {
            unsigned int NOB = Pattern->attributeValue("NumOfBeats");
            QString Name = Pattern->attribute("Name");
            PatternType* P=new PatternType(Name,NOB);
            m_DM->Patterns.append(P);
            P->Tempo= Pattern->attributeValue("Tempo");
            //P->Polyphony= Pattern->attributeValue("Sounds");
            QDomLiteElementList XMLBeats = Pattern->elementsByTag("Beat");
            for (unsigned int i=0;i<XMLBeats.size();i++)
            {
                QDomLiteElement* Beat=XMLBeats[i];
                if (i<NOB)
                {
                    BeatType* B = P->Beat(i);
                        B->Pitch[0]=Beat->attributeValue("Pitch");
                        B->Length[0]=Beat->attributeValue("Length");
                        B->Volume[0]=Beat->attributeValue("Volume");
                }
            }
        }
コード例 #3
0
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);
        }
    }
}
コード例 #4
0
void
JXFSBindingTable::PrepareDeleteXInputField()
{
	itsTextInput = NULL;

	JPoint cell;
	if ((GetTableSelection()).GetSingleSelectedCell(&cell))
		{
		const JFSBinding* b = itsBindingList->GetBinding(cell.y);
		JFSBinding::CommandType type;
		JBoolean singleFile;
		if ((b->GetPattern()).IsEmpty() ||
			(b->GetCommand(&type, &singleFile)).IsEmpty())
			{
			RemovePattern();
			}
		}

	UpdateButtons();
}