~ubuntu-branches/ubuntu/trusty/lmms/trusty

« back to all changes in this revision

Viewing changes to plugins/vestige/vestige.cpp

  • Committer: Package Import Robot
  • Author(s): Israel Dahl
  • Date: 2013-02-28 20:58:18 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130228205818-spbc545gwofxkkif
Tags: 0.4.14-0ubuntu1
* New upstream release.
  - Graphically enhanced AudioFileProcessor plugin
  - Fixed bug with magnetic knobs
  - Fixed various crashes
  - Completely revised VST support (improved VST effect support,
  timesync support and many more)
  - Added multitrack export
  - Added Hydrogen song import plugin
  - Fixed wrong chords
  - Improvements to automation framework
* debian/lmms.install debian/lmms-common.install
  - moved /usr/share/applications to lmms.install
* debian/control
  - updated Standards-Version to 3.9.4
* debian/copyright
  - updated to make current
* debian/rules
  - fixed Lintian errors during build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * vestige.cpp - instrument-plugin for hosting VST-instruments
3
3
 *
4
 
 * Copyright (c) 2005-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
4
 * Copyright (c) 2005-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
5
 * 
6
6
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
7
7
 *
398
398
        m_rolLPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
399
399
                                                        "stepper-left" ) );
400
400
        connect( m_rolLPresetButton, SIGNAL( clicked() ), this,
401
 
                                                SLOT( rolrPreset() ) );
 
401
                                                SLOT( previousProgram() ) );
402
402
        toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) );
403
403
 
404
404
        m_rolLPresetButton->setShortcut( Qt::Key_Minus );
432
432
        m_rolRPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
433
433
                                                        "stepper-right" ) );
434
434
        connect( m_rolRPresetButton, SIGNAL( clicked() ), this,
435
 
                                                SLOT( rollPreset() ) );
 
435
                                                SLOT( nextProgram() ) );
436
436
        toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) );
437
437
 
438
438
        m_rolRPresetButton->setShortcut( Qt::Key_Plus );
501
501
{
502
502
 
503
503
        // get all presets -
504
 
        if ( m_vi->m_plugin != NULL ) {
505
 
                m_vi->m_plugin->loadPrograms( 1 );
 
504
        if ( m_vi->m_plugin != NULL )
 
505
        {
 
506
                m_vi->m_plugin->loadProgramNames();
506
507
                QWidget::update();
507
508
 
508
 
                QString str = m_vi->m_plugin->presetsString();
 
509
                QString str = m_vi->m_plugin->allProgramNames();
509
510
 
510
511
                QStringList list1 = str.split("|");
511
512
 
600
601
 
601
602
 
602
603
 
603
 
void VestigeInstrumentView::openPreset( void )
 
604
void VestigeInstrumentView::openPreset()
604
605
{
605
606
 
606
607
        if ( m_vi->m_plugin != NULL ) {
607
608
                m_vi->m_plugin->openPreset( );
608
609
                bool converted;
609
 
                QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
 
610
                QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
610
611
                if (str != "")
611
612
                        lastPosInMenu = str.toInt(&converted, 10) - 1;
612
613
                QWidget::update();
617
618
 
618
619
 
619
620
 
620
 
void VestigeInstrumentView::savePreset( void )
 
621
void VestigeInstrumentView::savePreset()
621
622
{
622
623
 
623
 
        if ( m_vi->m_plugin != NULL ) {
 
624
        if ( m_vi->m_plugin != NULL )
 
625
        {
624
626
                m_vi->m_plugin->savePreset( );
625
627
/*              bool converted;
626
628
                QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
634
636
 
635
637
 
636
638
 
637
 
void VestigeInstrumentView::rollPreset( void )
 
639
void VestigeInstrumentView::nextProgram()
638
640
{
639
641
 
640
642
        if ( m_vi->m_plugin != NULL ) {
641
 
                m_vi->m_plugin->rollPreset( 1 );
 
643
                m_vi->m_plugin->rotateProgram( 1 );
642
644
                bool converted;
643
 
                QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
 
645
                QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
644
646
                if (str != "")
645
647
                        lastPosInMenu = str.toInt(&converted, 10) - 1;
646
648
                QWidget::update();
650
652
 
651
653
 
652
654
 
653
 
void VestigeInstrumentView::rolrPreset( void )
 
655
void VestigeInstrumentView::previousProgram()
654
656
{
655
657
 
656
658
        if ( m_vi->m_plugin != NULL ) {
657
 
                m_vi->m_plugin->rollPreset( -1 );
 
659
                m_vi->m_plugin->rotateProgram( -1 );
658
660
                bool converted;
659
 
                QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
 
661
                QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
660
662
                if (str != "")
661
663
                        lastPosInMenu = str.toInt(&converted, 10) - 1;
662
664
                QWidget::update();
673
675
     if (action)
674
676
         if ( m_vi->m_plugin != NULL ) {
675
677
                lastPosInMenu = action->data().toInt();
676
 
                m_vi->m_plugin->rollPreset( action->data().toInt() + 2 );
 
678
                m_vi->m_plugin->setProgram( action->data().toInt() );
677
679
                QWidget::update();
678
680
         }
679
681
}
711
713
        m_vi->m_pluginMutex.lock();
712
714
        if( m_vi->m_plugin != NULL )
713
715
        {
714
 
                for( int key = 0; key < NumKeys; ++key )
 
716
                for( int key = 0; key <= MidiMaxNote; ++key )
715
717
                {
716
718
                        m_vi->m_plugin->processMidiEvent(
717
719
                                midiEvent( MidiNoteOff, 0, key, 0 ), 0 );
790
792
                p.setFont( pointSize<8>( f ) );
791
793
                p.drawText( 10, 114, tr( "by" ) + " " +
792
794
                                        m_vi->m_plugin->vendorString() );
793
 
                p.drawText( 10, 225, m_vi->m_plugin->presetString() );
 
795
                p.drawText( 10, 225, m_vi->m_plugin->currentProgramName() );
794
796
        }
795
797
//      m_pluginMutex.unlock();
796
798
}