32 |
|
|
33 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
34 |
#include "gig.h" |
#include "gig.h" |
35 |
|
#ifdef CONFIG_LIBGIG_SF2 |
36 |
#include "SF.h" |
#include "SF.h" |
37 |
#endif |
#endif |
38 |
|
#endif |
39 |
|
|
40 |
namespace QSampler { |
namespace QSampler { |
41 |
|
|
760 |
|
|
761 |
|
|
762 |
// Redirected messages output methods. |
// Redirected messages output methods. |
763 |
void Channel::appendMessages( const QString& s ) const |
void Channel::appendMessages ( const QString& sText ) const |
764 |
{ |
{ |
765 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
766 |
if (pMainForm) |
if (pMainForm) |
767 |
pMainForm->appendMessages(channelName() + ' ' + s); |
pMainForm->appendMessages(channelName() + ' ' + sText); |
768 |
} |
} |
769 |
|
|
770 |
void Channel::appendMessagesColor( const QString& s, |
void Channel::appendMessagesColor ( |
771 |
const QString& c ) const |
const QString& sText, const QString& sColor ) const |
772 |
{ |
{ |
773 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
774 |
if (pMainForm) |
if (pMainForm) |
775 |
pMainForm->appendMessagesColor(channelName() + ' ' + s, c); |
pMainForm->appendMessagesColor(channelName() + ' ' + sText, sColor); |
776 |
} |
} |
777 |
|
|
778 |
void Channel::appendMessagesText( const QString& s ) const |
void Channel::appendMessagesText ( const QString& sText ) const |
779 |
{ |
{ |
780 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
781 |
if (pMainForm) |
if (pMainForm) |
782 |
pMainForm->appendMessagesText(channelName() + ' ' + s); |
pMainForm->appendMessagesText(channelName() + ' ' + sText); |
783 |
} |
} |
784 |
|
|
785 |
void Channel::appendMessagesError( const QString& s ) const |
void Channel::appendMessagesError ( const QString& sText ) const |
786 |
{ |
{ |
787 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
788 |
if (pMainForm) |
if (pMainForm) |
789 |
pMainForm->appendMessagesError(channelName() + "\n\n" + s); |
pMainForm->appendMessagesError(channelName() + "\n\n" + sText); |
790 |
} |
} |
791 |
|
|
792 |
void Channel::appendMessagesClient( const QString& s ) const |
void Channel::appendMessagesClient ( const QString& sText ) const |
793 |
{ |
{ |
794 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
795 |
if (pMainForm) |
if (pMainForm) |
796 |
pMainForm->appendMessagesClient(channelName() + ' ' + s); |
pMainForm->appendMessagesClient(channelName() + ' ' + sText); |
797 |
} |
} |
798 |
|
|
799 |
|
|
800 |
// Context menu event handler. |
// Context menu event handler. |
801 |
void Channel::contextMenuEvent( QContextMenuEvent *pEvent ) |
void Channel::contextMenuEvent ( QContextMenuEvent *pEvent ) |
802 |
{ |
{ |
803 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
804 |
if (pMainForm) |
if (pMainForm) |
862 |
RIFF::File *pRiff |
RIFF::File *pRiff |
863 |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
864 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
865 |
#if HAVE_LIBGIG_SETAUTOLOAD |
#ifdef CONFIG_LIBGIG_SETAUTOLOAD |
866 |
// prevent sleepy response time on large .gig files |
// prevent sleepy response time on large .gig files |
867 |
pGig->SetAutoLoad(false); |
pGig->SetAutoLoad(false); |
868 |
#endif |
#endif |
874 |
delete pGig; |
delete pGig; |
875 |
delete pRiff; |
delete pRiff; |
876 |
} |
} |
877 |
|
#ifdef CONFIG_LIBGIG_SF2 |
878 |
else |
else |
879 |
if (isSf2InstrumentFile(sInstrumentFile)) { |
if (isSf2InstrumentFile(sInstrumentFile)) { |
880 |
RIFF::File *pRiff |
RIFF::File *pRiff |
893 |
delete pSf2; |
delete pSf2; |
894 |
delete pRiff; |
delete pRiff; |
895 |
} |
} |
896 |
|
#endif |
897 |
} |
} |
898 |
#endif |
#endif |
899 |
|
|
924 |
RIFF::File *pRiff |
RIFF::File *pRiff |
925 |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
926 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
927 |
#if HAVE_LIBGIG_SETAUTOLOAD |
#ifdef CONFIG_LIBGIG_SETAUTOLOAD |
928 |
// prevent sleepy response time on large .gig files |
// prevent sleepy response time on large .gig files |
929 |
pGig->SetAutoLoad(false); |
pGig->SetAutoLoad(false); |
930 |
#endif |
#endif |
941 |
delete pGig; |
delete pGig; |
942 |
delete pRiff; |
delete pRiff; |
943 |
} |
} |
944 |
|
#ifdef CONFIG_LIBGIG_SF2 |
945 |
else |
else |
946 |
if (isSf2InstrumentFile(sInstrumentFile)) { |
if (isSf2InstrumentFile(sInstrumentFile)) { |
947 |
RIFF::File *pRiff |
RIFF::File *pRiff |
953 |
delete pSf2; |
delete pSf2; |
954 |
delete pRiff; |
delete pRiff; |
955 |
} |
} |
956 |
|
#endif |
957 |
} |
} |
958 |
#endif |
#endif |
959 |
|
|