--- qsampler/trunk/src/qsamplerChannel.cpp 2004/11/17 15:41:58 299 +++ qsampler/trunk/src/qsamplerChannel.cpp 2004/11/19 16:54:53 306 @@ -22,6 +22,7 @@ #include "qsamplerChannel.h" #include "qsamplerMainForm.h" +#include "qsamplerChannelForm.h" #include "config.h" @@ -30,7 +31,7 @@ #ifdef CONFIG_LIBGIG #include "gig.h" #else -#define QSAMPLER_INSTRUMENT_MAX 10 +#define QSAMPLER_INSTRUMENT_MAX 8 #endif @@ -402,30 +403,53 @@ } +// Channel setup dialog form. +bool qsamplerChannel::channelSetup ( QWidget *pParent ) +{ + bool bResult = false; + + qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(pParent); + if (pChannelForm) { + pChannelForm->setup(this); + bResult = pChannelForm->exec(); + delete pChannelForm; + } + + return bResult; +} + + // Redirected messages output methods. void qsamplerChannel::appendMessages( const QString& s ) { - m_pMainForm->appendMessages(s); + if (m_pMainForm) m_pMainForm->appendMessages(s); } void qsamplerChannel::appendMessagesColor( const QString& s, const QString& c ) { - m_pMainForm->appendMessagesColor(s, c); + if (m_pMainForm) m_pMainForm->appendMessagesColor(s, c); } void qsamplerChannel::appendMessagesText( const QString& s ) { - m_pMainForm->appendMessagesText(s); + if (m_pMainForm) m_pMainForm->appendMessagesText(s); } void qsamplerChannel::appendMessagesError( const QString& s ) { - m_pMainForm->appendMessagesError(s); + if (m_pMainForm) m_pMainForm->appendMessagesError(s); } void qsamplerChannel::appendMessagesClient( const QString& s ) { - m_pMainForm->appendMessagesClient(s); + if (m_pMainForm) m_pMainForm->appendMessagesClient(s); +} + + +// Context menu event handler. +void qsamplerChannel::contextMenuEvent( QContextMenuEvent *pEvent ) +{ + if (m_pMainForm) m_pMainForm->contextMenuEvent(pEvent); } @@ -442,8 +466,7 @@ gig::File *pGig = new gig::File(pRiff); gig::Instrument *pInstrument = pGig->GetFirstInstrument(); while (pInstrument) { - sInstrumentName = (pInstrument->pInfo)->Name; - instlist.append(sInstrumentName); + instlist.append((pInstrument->pInfo)->Name.c_str()); pInstrument = pGig->GetNextInstrument(); } delete pGig; @@ -454,7 +477,7 @@ #endif } else instlist.append(sInstrumentName); - + return instlist; } @@ -473,7 +496,7 @@ gig::Instrument *pInstrument = pGig->GetFirstInstrument(); while (pInstrument) { if (iIndex == iInstrumentNr) { - sInstrumentName = (pInstrument->pInfo)->Name; + sInstrumentName = (pInstrument->pInfo)->Name.c_str(); break; } iIndex++;