diff --git a/ChangeLog b/ChangeLog index 9607422c8..f6fa354db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2007-11-27 Javier Serrano Polo + + * include/main_window.h: + * include/song_editor.h: + * src/core/engine.cpp: + * src/core/main_window.cpp: + * src/core/song_editor.cpp: + * src/lib/project_journal.cpp: + added modified project indicator + + * include/ladspa_base.h: + * include/plugin.h: + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/ladspa_effect/ladspa_subplugin_features.cpp: + * plugins/ladspa_effect/ladspa_subplugin_features.h: + fixed invalid key segfault + + * src/core/main_window.cpp: + fixed instrument track visual glitches when loading + + * include/instrument_track.h: + * src/tracks/instrument_track.cpp: + removed QMdiSubWindow inheritance, fixes MDI focus segfault + + * src/core/track_container.cpp: + fixed interrupted loading segfault + + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/ladspa_effect/ladspa_effect.h: + removed singleton reference + + * src/core/config_mgr.cpp: + integrated mkPath() calls + + * plugins/ladspa_browser/ladspa_browser.cpp: + centralized title change + + * include/song_editor.h: + * src/core/song_editor.cpp: + reduced dependencies + + * data/locale/ca.ts: + updated translation + 2007-11-26 Paul Giblock * plugins/lb302/lb302.cpp: diff --git a/configure.in b/configure.in index 82b03e9ed..ab83448a7 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20071123, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20071123) +AC_INIT(lmms, 0.4.0-svn20071127, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20071127) AM_CONFIG_HEADER(config.h) diff --git a/data/locale/ca.qm b/data/locale/ca.qm index 93b198f92..f119e6c1b 100644 Binary files a/data/locale/ca.qm and b/data/locale/ca.qm differ diff --git a/data/locale/ca.ts b/data/locale/ca.ts index d9daf3527..6cf3bf14d 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -1,5 +1,6 @@ + QWidget @@ -1206,12 +1207,12 @@ http://lmms.sourceforge.net configManager - + Setup LMMS Configuració de LMMS - + LMMS needs to be setup in order to run properly. This wizard will help you to setup your personal LMMS-installation. If you're unsure what to do at a step, just click on 'Next'. LMMS will automatically select the best options for you. @@ -1225,7 +1226,7 @@ Si no estàs segur del que s'ha de fer en un pas, senzillament pica 'S Ara pica 'Següent' per a anar a la següent pàgina. - + When working with LMMS there needs to be a working-directory. This directory is used for storing your projects, presets, samples etc. @@ -1238,81 +1239,81 @@ Aquest directori s'usarà per a emmagatzemar els teus projectes, plantilles Per favor, selecciona un directori: - + Welcome to LMMS Benvingut a LMMS - + Select working directory Selecciona directori de treball - + Directory not existing El directori no existeix - + Error in configuration-file Error al fitxer de configuració - + Error while parsing configuration-file %1. The setup-wizard will be shown for reconfiguring LMMS. Error analitzant el fitxer de configuració %1. Es mostrarà l'assistent per a reconfigurar LMMS. - + The directory you specified does not exist. Create it? El directori especificat no existeix. Crear-lo? - + < &Back < &Enrere - + &Finish &Finalitza - + Could not save config-file No s'ha pogut desar el fitxer de configuració - + Could not save configuration file %1. You probably are not permitted to write to this file. Please make sure you have write-access to the file and try again. No s'ha pogut desar el fitxer de configuració %1. Per favor, comprova que tens permís d'escriptura per a aquest fitxer i torna-ho a provar. - + Version mismatches La versió no coincideix - + &Cancel &Cancel·la - + &Next > &Següent > - + Choose LMMS working directory Escull el directori de treball de LMMS - + Accordingly to the information in your LMMS-configuration-file you seem to have run a different (probably older) version of LMMS before. It is recommended to run the setup-wizard again to ensure that the latest samples, presets, demo-projects etc. are installed in your LMMS-working-directory. Run the setup-wizard now? @@ -1967,62 +1968,62 @@ Assegura't que tens permís d'escriptura per al fitxer/dispositiu sele instrumentTrack - + With this knob you can set the volume of the opened channel. Amb aquesta roda pots ajustar el volum del canal obert. - + Within this rectangle you can set the position where the channel should be audible. You should have a soundcard supporting at least surround 4.0 for enjoying this feature. Amb aquest rectangle pots ajustar la posició on el canal ha de ser audible. Necessites una targeta de so que suporti almenys l'envoltant 4.0 per a gaudir d'aquesta característica. - + unnamed_channel canal_sense_nom - + Channel volume Volum del canal - + Channel volume: Volum del canal: - + VOL VOL - + MIDI input/output Entrada/sortida MIDI - + GENERAL SETTINGS CONFIGURACIÓ GENERAL - + VOLUME VOLUM - + FX CHNL CANAL FX - + Save current channel settings in a preset-file Desa la configuració del canal actual en una plantilla - + Click here, if you want to save current channel settings in a preset-file. Later you can load this preset by double-clicking it in the preset-browser. Pica aquí si vols desar la configuració del canal actual en una plantilla. Més tard podràs carregar aquesta plantilla picant-la dos cops al navegador de plantilles. @@ -2032,57 +2033,57 @@ Assegura't que tens permís d'escriptura per al fitxer/dispositiu sele Defecte - + ENV/LFO/FILTER ENV/OBF/FILTRE - + ARP/CHORD ARP/ACORD - + MIDI MIDI - + MIDI input Entrada MIDI - + MIDI output Sortida MIDI - + Save channel-settings in file Desa configuració de canal en fitxer - + Channel-Settings-File (*.cs.xml) Fitxer de Configuració de Canal (*.cs.xml) - + PLUGIN CONN - + Surround area Àrea envoltant - + FX channel Canal FX - + FX FX @@ -2259,6 +2260,11 @@ Desconeguts són connectors on no s'han identificat canals d'entrada o Fent doble clic a qualsevol connector mostrarà informació sobre els ports. + + + Type: + Tipus: + ladspaControl @@ -2342,42 +2348,42 @@ Fent doble clic a qualsevol connector mostrarà informació sobre els ports.Depenent SR - + Audio Àudio - + Control Control - + Input Entrada - + Output Sortida - + Toggled Commutat - + Integer Enter - + Float Flotant - + Yes @@ -2484,11 +2490,6 @@ Fent doble clic a qualsevol connector mostrarà informació sobre els ports.SLIDE LLISCA - - - Fine detuning of the VCO. Ranged between -100 and 100 centes. - Desafinament fi del VCO. Graduat entre -100 i 100 cents. - VCO Fine Detuning: @@ -2559,6 +2560,11 @@ Fent doble clic a qualsevol connector mostrarà informació sobre els ports.WAVE: ONA: + + + Fine detuning of the VCO. Ranged between -100 and 100 centes. + Desafinament fi del VCO. Graduat entre -100 i 100 cents. + lcdSpinBox @@ -2753,12 +2759,12 @@ Les tecles F1-F10 apaguen els 10 primers instruments a l'Editor de Ritme Ba &Projecte - + Open project Obre projecte - + Save project Desa projecte @@ -2823,7 +2829,7 @@ Les tecles F1-F10 apaguen els 10 primers instruments a l'Editor de Ritme Ba Mostra el diàleg de configuració - + Help not available Ajuda no disponible @@ -2843,12 +2849,12 @@ Les tecles F1-F10 apaguen els 10 primers instruments a l'Editor de Ritme Ba E&ines - + MultiMedia Project (*.mmp *.mmpz *.xml) Projecte MultiMèdia (*.mmp *.mmpz *.xml) - + MultiMedia Project (*.mmp *.mmpz);;MultiMedia Project Template (*.mpt) Projecte MultiMèdia (*.mmp *.mmpz);;Plantilla de Projecte MultiMèdia (*.mpt) @@ -2868,7 +2874,7 @@ Les tecles F1-F10 apaguen els 10 primers instruments a l'Editor de Ritme Ba E&xporta... - + Currently there's no help available in LMMS. Please visit http://lmms.sf.net/wiki for documentation on LMMS. Actualment no hi ha ajuda disponible a LMMS. @@ -2879,6 +2885,11 @@ Per favor, visita http://lmms.sf.net/wiki per a documentació sobre LMMS.Recently opened projects Projectes oberts recentment + + + Untitled + Sense títol + mallets @@ -3715,12 +3726,7 @@ usa la roda del ratolí per a ajustar el volum d'un pas Coses melòdiques per a fer soroll - - Incomplete monophonic immitation tb303 - Imitació monofònica incompleta tb303 - - - + plugin for using arbitrary LADSPA-effects inside LMMS. connector per a usar efectes LADSPA arbitraris a LMMS. @@ -3764,6 +3770,11 @@ usa la roda del ratolí per a ajustar el volum d'un pas List installed LADSPA plugins Llista connectors LADSPA instal·lats + + + Incomplete monophonic immitation tb303 + Imitació monofònica incompleta tb303 + polyb302Synth @@ -4592,12 +4603,12 @@ Fixa't que en alguns casos la paral·lelització no funcionarà amb memòri songEditor - + Click here, if you want to stop playing of your song. The song-position-marker will be set to the start of your song. Pica aquí si vols aturar la reproducció de la cançó. El marcador de posició de cançó serà col·locat a l'inici de la cançó. - + untitled sense títol @@ -4627,57 +4638,57 @@ Fixa't que en alguns casos la paral·lelització no funcionarà amb memòri No es pot escriure el fitxer - + Song-Editor Editor de Cançó - + The file "%1" already exists. Do you want to overwrite it? El fitxer "%1" ja existeix. Vols sobreescriure'l? - + Click here, if you want to play your whole song. Playing will be started at the song-position-marker (green). You can also move it while playing. Pica aquí si vols reproduir la cançó sencera. La reproducció començarà al marcador de posició de cançó (verd). També pots moure'l mentre es reprodueix. - + Play song (Space) Reprodueix cançó (Espai) - + Stop song (Space) Atura cançó (Espai) - + The tempo of a song is specified in beats per minute (BPM). If you want to change the tempo of your song, change this value. Every tact has four beats, so the tempo in BPM specifies, how many tacts / 4 should be played within a minute (or how many tacts should be played within four minutes). El tempo d'una cançó s'especifica en batecs per minut (BPM). Si vols canviar el tempo de la cançó, canvia aquest valor. Cada compàs té quatre batecs, llavors el tempo en BPM especifica quants compassos / 4 s'han de tocar en un minut (o quants compassos s'han de tocar en quatre minuts). - + master pitch to mestre - + tempo of song tempo de cançó - + Add beat/bassline Afegeix ritme base - + Add sample-track Afegeix pista de mostra - + Project NOT saved. Projecte NO desat. @@ -4689,27 +4700,27 @@ Do you want to overwrite it? Vols sobreescriure'l? - + Select file for project-export... Selecciona fitxer per a exportar projecte... - + Project not saved Projecte no desat - + The current project was modified since last saving. Do you want to save it now? El projecte actual ha estat modificat des del darrer desament. Vols desar-lo ara? - + Import file Importa fitxer - + TEMPO/BPM TEMPO/BPM @@ -4721,62 +4732,62 @@ Please make sure you have at least read-access to the file and try again. - + High quality mode Mode alta qualitat - + Auto limiter Autolimitador - + master volume volum mestre - + Master volume Volum mestre - + Master pitch To mestre - + Draw mode Mode dibuixar - + Edit mode (select and move) Mode editar (selecciona i mou) - + Value: %1% Valor: %1% - + Value: %1 semitones Valor: %1 semitons - + Project saved Projecte desat - + The project %1 is now saved. El projecte %1 està desat. - + The project %1 was not saved! El projecte %1 no està desat! @@ -4788,7 +4799,7 @@ Please make sure you have write-access to the file and try again. Per favor, assegura't que tens permís d'escriptura per a aquest fitxer i torna-ho a provar. - + Tempo Tempo diff --git a/include/instrument_track.h b/include/instrument_track.h index ccd822e4b..6f3dd9e29 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -27,10 +27,8 @@ #ifndef _INSTRUMENT_TRACK_H #define _INSTRUMENT_TRACK_H -#include #include #include -#include #include "midi_event_processor.h" #include "mixer.h" @@ -55,7 +53,7 @@ class surroundArea; class volumeKnob; -class instrumentTrack : public QMdiSubWindow, public track, public midiEventProcessor +class instrumentTrack : public QWidget, public track, public midiEventProcessor { Q_OBJECT public: diff --git a/include/ladspa_base.h b/include/ladspa_base.h index d4813233a..ea6e427ec 100644 --- a/include/ladspa_base.h +++ b/include/ladspa_base.h @@ -69,13 +69,6 @@ typedef struct portDescription } port_desc_t; -inline ladspa_key_t subPluginKeyToLadspaKey( - const plugin::descriptor::subPluginFeatures::key * _key ) -{ - return( ladspa_key_t( _key->user.toStringList().first(), - _key->user.toStringList().last() ) ); -} - inline plugin::descriptor::subPluginFeatures::key ladspaKeyToSubPluginKey( plugin::descriptor * _desc, const QString & _name, diff --git a/include/main_window.h b/include/main_window.h index 6e309098f..38aee6f20 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -58,7 +58,7 @@ public: int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 ); void addSpacingToToolBar( int _size ); - void resetWindowTitle( const QString & _add = "" ); + void resetWindowTitle( void ); void clearKeyModifiers( void ); diff --git a/include/plugin.h b/include/plugin.h index 52b7d60fd..4356546ab 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -93,8 +93,16 @@ public: const QList l = base64::decode( _dump_data ). toList(); - name = l[0].toString(); - user = l[1]; + if( l.empty() ) + { + name = QString::null; + user = QVariant(); + } + else + { + name = l[0].toString(); + user = l[1]; + } } inline QString dumpBase64( void ) const { diff --git a/include/song_editor.h b/include/song_editor.h index 9185fc700..da7bcac21 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -28,7 +28,6 @@ #define _SONG_EDITOR_H #include "track_container.h" -#include "tool_button.h" class QLabel; @@ -40,6 +39,7 @@ class lcdSpinBox; class pattern; class textFloat; class timeLine; +class toolButton; const bpm_t MIN_BPM = 10; @@ -183,10 +183,7 @@ public slots: void setMasterVolume( volume _vol ); void setMasterPitch( int _master_pitch ); - inline void setModified( void ) - { - m_modified = TRUE; - } + void setModified( void ); void clearProject( void ); @@ -200,10 +197,7 @@ protected: virtual QRect scrollAreaRect( void ) const; - virtual bool allowRubberband( void ) const - { - return( m_editModeButton->isChecked() ); - } + virtual bool allowRubberband( void ) const; protected slots: @@ -275,7 +269,6 @@ private: QString m_fileName; QString m_oldFileName; - bool m_modified; volatile bool m_exporting; volatile bool m_playing; diff --git a/plugins/ladspa_browser/ladspa_browser.cpp b/plugins/ladspa_browser/ladspa_browser.cpp index 5fb0f8e0c..e71baef46 100644 --- a/plugins/ladspa_browser/ladspa_browser.cpp +++ b/plugins/ladspa_browser/ladspa_browser.cpp @@ -86,13 +86,12 @@ ladspaBrowser::ladspaBrowser( void ) : QWidget * ws = new QWidget( this ); ws->setFixedSize( 500, 480 ); - const QString type = "" + tr( "Type:" ) + " "; - QWidget * available = createTab( ws, type + tr( "Available Effects" ), VALID ); - QWidget * unavailable = createTab( ws, type + tr( "Unavailable Effects" ), + QWidget * available = createTab( ws, tr( "Available Effects" ), VALID ); + QWidget * unavailable = createTab( ws, tr( "Unavailable Effects" ), INVALID ); - QWidget * instruments = createTab( ws, type + tr( "Instruments" ), SOURCE ); - QWidget * analysis = createTab( ws, type + tr( "Analysis Tools" ), SINK ); - QWidget * other = createTab( ws, type + tr( "Don't know" ), OTHER ); + QWidget * instruments = createTab( ws, tr( "Instruments" ), SOURCE ); + QWidget * analysis = createTab( ws, tr( "Analysis Tools" ), SINK ); + QWidget * other = createTab( ws, tr( "Don't know" ), OTHER ); m_tabBar->addTab( available, tr( "Available Effects" ), @@ -185,7 +184,8 @@ QWidget * ladspaBrowser::createTab( QWidget * _parent, const QString & _txt, layout->setSpacing( 0 ); layout->setMargin( 0 ); - QLabel * title = new QLabel( _txt, tab ); + const QString type = "" + tr( "Type:" ) + " "; + QLabel * title = new QLabel( type + _txt, tab ); QFont f = title->font(); f.setBold( TRUE ); title->setFont( pointSize<12>( f ) ); diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 6699d1ead..4cc297183 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -23,14 +23,16 @@ */ +#include "ladspa_effect.h" + #include -#include "ladspa_effect.h" -#include "mixer.h" -#include "config_mgr.h" #include "audio_device.h" +#include "config_mgr.h" +#include "ladspa_2_lmms.h" #include "ladspa_control.h" #include "ladspa_subplugin_features.h" +#include "mixer.h" #undef SINGLE_SOURCE_COMPILE @@ -60,12 +62,12 @@ plugin::descriptor ladspaeffect_plugin_descriptor = ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : effect( &ladspaeffect_plugin_descriptor, _key ), m_effName( "none" ), - m_key( subPluginKeyToLadspaKey( _key ) + m_key( ladspaSubPluginFeatures::subPluginKeyToLadspaKey( _key ) /* ladspa_key_t( _cdata->settings.attribute( "label" ), - _cdata->settings.attribute( "lib" ) )*/ ), - m_ladspa( engine::getLADSPAManager() ) + _cdata->settings.attribute( "lib" ) )*/ ) { - if( m_ladspa->getDescription( m_key ) == NULL ) + ladspa2LMMS * manager = engine::getLADSPAManager(); + if( manager->getDescription( m_key ) == NULL ) { QMessageBox::warning( 0, "Effect", "Unknown LADSPA plugin requested: " + m_key.first, @@ -74,15 +76,15 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : return; } - setPublicName( m_ladspa->getShortName( m_key ) ); + setPublicName( manager->getShortName( m_key ) ); // Calculate how many processing units are needed. const ch_cnt_t lmms_chnls = engine::getMixer()->audioDev()->channels(); - m_effectChannels = m_ladspa->getDescription( m_key )->inputChannels; + m_effectChannels = manager->getDescription( m_key )->inputChannels; setProcessorCount( lmms_chnls / m_effectChannels ); // Categorize the ports, and create the buffers. - m_portCount = m_ladspa->getPortCount( m_key ); + m_portCount = manager->getPortCount( m_key ); for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) { @@ -91,13 +93,13 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : { port_desc_t * p = new portDescription; - p->name = m_ladspa->getPortName( m_key, port ); + p->name = manager->getPortName( m_key, port ); p->proc = proc; p->port_id = port; p->control = NULL; // Determine the port's category. - if( m_ladspa->isPortAudio( m_key, port ) ) + if( manager->isPortAudio( m_key, port ) ) { // Nasty manual memory management--was having difficulty // with some prepackaged plugins that were segfaulting @@ -105,18 +107,18 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : // memory management all taking place in one file. p->buffer = new LADSPA_Data[engine::getMixer()->framesPerPeriod()]; - - if( p->name.toUpper().contains( "IN" ) && - m_ladspa->isPortInput( m_key, port ) ) + + if( p->name.toUpper().contains( "IN" ) && + manager->isPortInput( m_key, port ) ) { p->rate = CHANNEL_IN; } - else if( p->name.toUpper().contains( "OUT" ) && - m_ladspa->isPortOutput( m_key, port ) ) + else if( p->name.toUpper().contains( "OUT" ) && + manager->isPortOutput( m_key, port ) ) { p->rate = CHANNEL_OUT; } - else if( m_ladspa->isPortInput( m_key, port ) ) + else if( manager->isPortInput( m_key, port ) ) { p->rate = AUDIO_RATE_INPUT; } @@ -128,8 +130,8 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : else { p->buffer = new LADSPA_Data; - - if( m_ladspa->isPortInput( m_key, port ) ) + + if( manager->isPortInput( m_key, port ) ) { p->rate = CONTROL_RATE_INPUT; } @@ -138,13 +140,13 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : p->rate = CONTROL_RATE_OUTPUT; } } - + p->scale = 1.0f; - if( m_ladspa->isPortToggled( m_key, port ) ) + if( manager->isPortToggled( m_key, port ) ) { p->data_type = TOGGLED; } - else if( m_ladspa->isInteger( m_key, port ) ) + else if( manager->isInteger( m_key, port ) ) { p->data_type = INTEGER; } @@ -173,34 +175,34 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : { p->data_type = FLOAT; } - + // Get the range and default values. - p->max = m_ladspa->getUpperBound( m_key, port ); + p->max = manager->getUpperBound( m_key, port ); if( p->max == NOHINT ) { p->max = p->name.toUpper() == "GAIN" ? 10.0f : 1.0f; } - - if( m_ladspa->areHintsSampleRateDependent( + + if( manager->areHintsSampleRateDependent( m_key, port ) ) { p->max *= engine::getMixer()->sampleRate(); } - - p->min = m_ladspa->getLowerBound( m_key, port ); + + p->min = manager->getLowerBound( m_key, port ); if( p->min == NOHINT ) { p->min = 0.0f; } - - if( m_ladspa->areHintsSampleRateDependent( + + if( manager->areHintsSampleRateDependent( m_key, port ) ) { p->min *= engine::getMixer()->sampleRate(); } - - p->def = m_ladspa->getDefaultSetting( m_key, port ); + + p->def = manager->getDefaultSetting( m_key, port ); if( p->def == NOHINT ) { if( p->data_type != TOGGLED ) @@ -212,16 +214,16 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : p->def = 1.0f; } } - + p->max *= p->scale; p->min *= p->scale; p->def *= p->scale; - + p->value = p->def; - - + + ports.append( p ); - + // For convenience, keep a separate list of the ports that are used // to control the processors. if( p->rate == AUDIO_RATE_INPUT || @@ -233,9 +235,9 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : } m_ports.append( ports ); } - + // Instantiate the processing units. - m_descriptor = m_ladspa->getDescriptor( m_key ); + m_descriptor = manager->getDescriptor( m_key ); if( m_descriptor == NULL ) { QMessageBox::warning( 0, "Effect", @@ -246,35 +248,34 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : } if( m_descriptor->run == NULL ) { - QMessageBox::warning( 0, "Effect", + QMessageBox::warning( 0, "Effect", "Plugin has no processor: " + m_key.first, QMessageBox::Ok, QMessageBox::NoButton ); setDontRun( TRUE ); } for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) { - LADSPA_Handle effect = m_ladspa->instantiate( m_key, + LADSPA_Handle effect = manager->instantiate( m_key, engine::getMixer()->sampleRate() ); if( effect == NULL ) { - QMessageBox::warning( 0, "Effect", + QMessageBox::warning( 0, "Effect", "Can't get LADSPA instance: " + m_key.first, QMessageBox::Ok, QMessageBox::NoButton ); setOkay( FALSE ); return; } m_handles.append( effect ); - } - + // Connect the ports. for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) { for( Uint16 port = 0; port < m_portCount; port++ ) { - if( !m_ladspa->connectPort( m_key, - m_handles[proc], - port, + if( !manager->connectPort( m_key, + m_handles[proc], + port, m_ports[proc][port]->buffer ) ) { QMessageBox::warning( 0, "Effect", @@ -285,11 +286,11 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) : } } } - + // Activate the processing units. for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) { - m_ladspa->activate( m_key, m_handles[proc] ); + manager->activate( m_key, m_handles[proc] ); } } @@ -302,11 +303,12 @@ ladspaEffect::~ladspaEffect() { return; } - + for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) { - m_ladspa->deactivate( m_key, m_handles[proc] ); - m_ladspa->cleanup( m_key, m_handles[proc] ); + ladspa2LMMS * manager = engine::getLADSPAManager(); + manager->deactivate( m_key, m_handles[proc] ); + manager->cleanup( m_key, m_handles[proc] ); for( Uint16 port = 0; port < m_portCount; port++ ) { free( m_ports[proc][port]->buffer ); diff --git a/plugins/ladspa_effect/ladspa_effect.h b/plugins/ladspa_effect/ladspa_effect.h index be843ba6a..2cdb0aaf4 100644 --- a/plugins/ladspa_effect/ladspa_effect.h +++ b/plugins/ladspa_effect/ladspa_effect.h @@ -29,7 +29,6 @@ #include "effect.h" #include "engine.h" -#include "ladspa_2_lmms.h" #include "ladspa_base.h" #include "ladspa_control.h" #include "ladspa_control_dialog.h" @@ -82,7 +81,6 @@ public: private: QString m_effName; ladspa_key_t m_key; - ladspa2LMMS * m_ladspa; Uint16 m_effectChannels; Uint16 m_portCount; fpp_t m_bufferSize; diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/ladspa_subplugin_features.cpp index 18ee4975b..4c1e21c5f 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/ladspa_subplugin_features.cpp @@ -26,16 +26,18 @@ */ -#include -#include -#include - - #include "ladspa_subplugin_features.h" -#include "ladspa_2_lmms.h" -#include "mixer.h" + + +#include +#include + + #include "audio_device.h" #include "engine.h" +#include "ladspa_2_lmms.h" +#include "ladspa_base.h" +#include "mixer.h" ladspaSubPluginFeatures::ladspaSubPluginFeatures( plugin::pluginTypes _type ) : @@ -155,3 +157,15 @@ void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, } + + +ladspa_key_t ladspaSubPluginFeatures::subPluginKeyToLadspaKey( + const key * _key ) +{ + QStringList list = _key->user.toStringList(); + if( list.empty() ) + { + return( ladspa_key_t() ); + } + return( ladspa_key_t( list.first(), list.last() ) ); +} diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.h b/plugins/ladspa_effect/ladspa_subplugin_features.h index 1e00c48a8..e6b485ef2 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.h +++ b/plugins/ladspa_effect/ladspa_subplugin_features.h @@ -29,8 +29,8 @@ #ifndef _LADSPA_SUBPLUGIN_FEATURES_H #define _LADSPA_SUBPLUGIN_FEATURES_H +#include "ladspa_manager.h" #include "plugin.h" -#include "ladspa_base.h" class ladspaSubPluginFeatures : public plugin::descriptor::subPluginFeatures @@ -44,6 +44,8 @@ public: virtual void listSubPluginKeys( plugin::descriptor * _desc, keyList & _kl ); + static ladspa_key_t subPluginKeyToLadspaKey( const key * _key ); + } ; #endif diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 3d4bb34f8..4c43255b8 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -49,15 +49,6 @@ -inline void mkPath( const QString & _path ) -{ -#warning TODO: directly integrate - // simple clean solution with Qt4... - QDir().mkpath( _path ); -} - - - /* void linkFile( const QString & _src, const QString & _dst ) { @@ -514,7 +505,7 @@ void configManager::accept( void ) QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { - mkPath( m_workingDir ); + QDir().mkpath( m_workingDir ); } else { @@ -523,9 +514,9 @@ void configManager::accept( void ) } } - mkPath( userProjectsDir() ); - mkPath( userSamplesDir() ); - mkPath( userPresetsDir() ); + QDir().mkpath( userProjectsDir() ); + QDir().mkpath( userSamplesDir() ); + QDir().mkpath( userPresetsDir() ); /* processFilesRecursively( m_dataDir + "samples/", m_workingDir + "samples/", m_samplesCopyRB->isChecked() ? @@ -923,7 +914,7 @@ void configManager::processFilesRecursively( const QString & _src_dir, const QString & _dst_dir, void( * _proc_func )( const QString & _src, const QString & _dst ) ) { - mkPath( _dst_dir ); + QDir().mkpath( _dst_dir ); QStringList files = QDir( _src_dir ).entryList(); for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) { diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 419ddf295..103e8ec9c 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -72,6 +72,8 @@ void engine::init( const bool _has_gui ) s_automationEditor = new automationEditor; s_ladspaManager = new ladspa2LMMS; + s_projectJournal->setJournalling( TRUE ); + s_mixer->initDevices(); s_mainWindow->finalize(); diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index db0a4a68a..badfb8afd 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -204,7 +204,7 @@ void mainWindow::finalize( void ) s_splashScreen->showMessage( tr( "Creating GUI..." ), splash_alignment_flags, Qt::white ); - resetWindowTitle( "" ); + resetWindowTitle(); setWindowIcon( embed::getIconPixmap( "icon" ) ); @@ -511,19 +511,20 @@ void mainWindow::addSpacingToToolBar( int _size ) -void mainWindow::resetWindowTitle( const QString & _add ) +void mainWindow::resetWindowTitle( void ) { - QString title = _add; - if( _add == "" && engine::getSongEditor()->projectFileName() != "" ) + QString title = ""; + if( engine::getSongEditor()->projectFileName() != "" ) { title = QFileInfo( engine::getSongEditor()->projectFileName() ).completeBaseName(); } - if( title != "" ) + if( title == "" ) { - title += " - "; + title = tr( "Untitled" ); } - setWindowTitle( title + tr( "LMMS %1" ).arg( VERSION ) ); + setWindowTitle( title + "[*] - " + tr( "LMMS %1" ).arg( VERSION ) ); + setWindowModified( FALSE ); } @@ -566,9 +567,7 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) _de.attribute( "height" ).toInt() ); if( !r.isNull()) { - _w->show(); - - if (_w->parentWidget() != NULL && + if ( _w->parentWidget() != NULL && _w->parentWidget()->inherits( "QMdiSubWindow" ) ) { _w = _w->parentWidget(); @@ -576,7 +575,7 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) _w->resize( r.size() ); _w->move( r.topLeft() ); - _w->setShown( _de.attribute( "visible" ).toInt() ); + _w->setVisible( _de.attribute( "visible" ).toInt() ); } } diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index 743650681..893023fdd 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -25,6 +25,9 @@ */ +#include "song_editor.h" + + #ifdef HAVE_CONFIG_H #include #endif @@ -32,7 +35,6 @@ #include -#include #include #include #include @@ -41,41 +43,40 @@ #include #include #include +#include #include #include #include -#include -#include "song_editor.h" #include "automatable_object_templates.h" #include "automatable_slider.h" #include "bb_editor.h" -#include "rename_dialog.h" -#include "embed.h" -#include "templates.h" -#include "export_project_dialog.h" #include "bb_track.h" +#include "combobox.h" +#include "config_mgr.h" +#include "cpuload_widget.h" +#include "embed.h" +#include "envelope_and_lfo_widget.h" +#include "export_project_dialog.h" +#include "import_filter.h" #include "instrument_track.h" -#include "mmp.h" +#include "lcd_spinbox.h" +#include "main_window.h" #include "midi_client.h" +#include "mmp.h" #include "note_play_handle.h" -#include "timeline.h" #include "pattern.h" #include "piano_roll.h" -#include "envelope_and_lfo_widget.h" -#include "visualization_widget.h" -#include "project_notes.h" -#include "config_mgr.h" -#include "lcd_spinbox.h" -#include "tooltip.h" -#include "tool_button.h" -#include "cpuload_widget.h" -#include "text_float.h" -#include "combobox.h" -#include "main_window.h" -#include "import_filter.h" #include "project_journal.h" +#include "project_notes.h" +#include "rename_dialog.h" +#include "templates.h" +#include "text_float.h" +#include "timeline.h" +#include "tool_button.h" +#include "tooltip.h" +#include "visualization_widget.h" #include "debug.h" @@ -1295,7 +1296,7 @@ automationPattern * songEditor::tempoAutomationPattern( void ) bool songEditor::mayChangeProject( void ) { - if( m_modified == FALSE ) + if( engine::getMainWindow()->isWindowModified() == FALSE ) { return( TRUE ); } @@ -1377,10 +1378,16 @@ void songEditor::createNewProject( void ) return; } + m_loadingProject = TRUE; + clearProject(); engine::getProjectJournal()->setJournalling( FALSE ); + m_fileName = m_oldFileName = ""; + + engine::getMainWindow()->resetWindowTitle(); + track * t; t = track::create( track::INSTRUMENT_TRACK, this ); dynamic_cast< instrumentTrack * >( t )->loadInstrument( @@ -1391,20 +1398,13 @@ void songEditor::createNewProject( void ) "tripleoscillator" ); track::create( track::BB_TRACK, this ); - m_loadingProject = TRUE; m_bpmSpinBox->setInitValue( DEFAULT_BPM ); m_masterVolumeSlider->setInitValue( 100 ); m_masterPitchSlider->setInitValue( 0 ); - m_loadingProject = FALSE; - - m_fileName = m_oldFileName = ""; - - m_modified = FALSE; - - engine::getMainWindow()->resetWindowTitle( "" ); engine::getProjectJournal()->setJournalling( TRUE ); + m_loadingProject = FALSE; } @@ -1425,6 +1425,8 @@ void FASTCALL songEditor::createNewProjectFromTemplate( const QString & // load given song void FASTCALL songEditor::loadProject( const QString & _file_name ) { + m_loadingProject = TRUE; + clearProject(); engine::getProjectJournal()->setJournalling( FALSE ); @@ -1432,8 +1434,6 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) m_fileName = _file_name; m_oldFileName = _file_name; - m_loadingProject = TRUE; - multimediaProject mmp( m_fileName ); // if file could not be opened, head-node is null and we create // new project @@ -1443,6 +1443,8 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) return; } + engine::getMainWindow()->resetWindowTitle(); + // get the header information from the DOM m_bpmSpinBox->loadSettings( mmp.head(), "bpm" ); m_masterVolumeSlider->loadSettings( mmp.head(), "mastervol" ); @@ -1490,16 +1492,13 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) node = node.nextSibling(); } - m_modified = FALSE; m_leftRightScroll->setValue( 0 ); - m_loadingProject = FALSE; - configManager::inst()->addRecentlyOpenedProject( _file_name ); - engine::getMainWindow()->resetWindowTitle( "" ); - engine::getProjectJournal()->setJournalling( TRUE ); + + m_loadingProject = FALSE; } @@ -1527,15 +1526,13 @@ bool songEditor::saveProject( void ) if( mmp.writeFile( m_fileName, m_oldFileName == "" || m_fileName != m_oldFileName ) == TRUE ) { - m_modified = FALSE; - textFloat::displayMessage( tr( "Project saved" ), tr( "The project %1 is now saved." ).arg( m_fileName ), embed::getIconPixmap( "project_save", 24, 24 ), 2000 ); configManager::inst()->addRecentlyOpenedProject( m_fileName ); - engine::getMainWindow()->resetWindowTitle( "" ); + engine::getMainWindow()->resetWindowTitle(); } else { @@ -1657,6 +1654,25 @@ void songEditor::updateFramesPerTact64th( void ) +void songEditor::setModified( void ) +{ + if( !m_loadingProject ) + { + engine::getMainWindow()->setWindowModified( TRUE ); + } +} + + + + +bool songEditor::allowRubberband( void ) const +{ + return( m_editModeButton->isChecked() ); +} + + + + #include "song_editor.moc" diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index 21149f6b2..4a86ca59b 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -113,6 +113,7 @@ void trackContainer::loadSettings( const QDomElement & _this ) pd = new QProgressDialog( tr( "Loading project..." ), tr( "Cancel" ), 0, _this.childNodes().count() ); + pd->setWindowModality( Qt::ApplicationModal ); pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); } diff --git a/src/lib/project_journal.cpp b/src/lib/project_journal.cpp index 23a185650..f641a1634 100644 --- a/src/lib/project_journal.cpp +++ b/src/lib/project_journal.cpp @@ -37,7 +37,7 @@ projectJournal::projectJournal( void ) : m_joIDs(), m_journalEntries(), m_currentJournalEntry( m_journalEntries.end() ), - m_journalling( TRUE ) + m_journalling( FALSE ) { } diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 800284ad1..f1290f275 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -29,7 +29,6 @@ #include "instrument_track.h" -#include #include #include #include @@ -38,10 +37,9 @@ #include #include #include +#include #include #include -#include -#include #include "arp_and_chords_tab_widget.h" @@ -98,7 +96,6 @@ const int PIANO_HEIGHT = 84; instrumentTrack::instrumentTrack( trackContainer * _tc ) : - QMdiSubWindow( engine::getMainWindow()->workspace() ), track( _tc ), midiEventProcessor(), m_trackType( INSTRUMENT_TRACK ), @@ -112,9 +109,6 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : m_midiInputAction( NULL ), m_midiOutputAction( NULL ) { - - QWidget * widget = new QWidget(); - for( int i = 0; i < NOTES; ++i ) { m_notes[i] = NULL; @@ -171,12 +165,12 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : // init own layout + widgets setFocusPolicy( Qt::StrongFocus ); - QVBoxLayout * vlayout = new QVBoxLayout( widget ); + QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setMargin( 0 ); vlayout->setSpacing( 0 ); m_generalSettingsWidget = new tabWidget( tr( "GENERAL SETTINGS" ), - widget ); + this ); m_generalSettingsWidget->setFixedHeight( 90 ); // setup line-edit for changing channel-name @@ -314,38 +308,40 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : _tc->updateAfterTrackAdd(); - setWidget( widget ); - setFixedWidth( INSTRUMENT_WIDTH ); resize( sizeHint() ); if( engine::getMainWindow()->workspace() ) { engine::getMainWindow()->workspace()->addSubWindow( this ); + parentWidget()->hide(); + } + else + { + hide(); } - - hide(); } - - instrumentTrack::~instrumentTrack() { engine::getMixer()->removePlayHandles( this ); delete m_effWidget; delete m_audioPort; engine::getMixer()->getMIDIClient()->removePort( m_midiPort ); + + if( engine::getMainWindow()->workspace() ) + { + parentWidget()->hide(); + parentWidget()->deleteLater(); + } } - - - void instrumentTrack::saveSettingsBtnClicked( void ) { QFileDialog sfd( this, tr( "Save channel-settings in file" ), "", @@ -1209,12 +1205,28 @@ void instrumentTrack::toggledInstrumentTrackButton( bool _on ) } if( _on ) { - show(); - raise(); + if( engine::getMainWindow()->workspace() ) + { + show(); + parentWidget()->show(); + parentWidget()->raise(); + } + else + { + show(); + raise(); + } } else { - hide(); + if( engine::getMainWindow()->workspace() ) + { + parentWidget()->hide(); + } + else + { + hide(); + } } } @@ -1224,7 +1236,14 @@ void instrumentTrack::toggledInstrumentTrackButton( bool _on ) void instrumentTrack::closeEvent( QCloseEvent * _ce ) { _ce->ignore(); - hide(); + if( engine::getMainWindow()->workspace() ) + { + parentWidget()->hide(); + } + else + { + hide(); + } m_tswInstrumentTrackButton->setChecked( FALSE ); }