Merge branch 'coding'
Conflicts: include/Note.h include/ProjectVersion.h include/TimeLineWidget.h include/Track.h src/core/Plugin.cpp src/core/ProjectVersion.cpp src/core/Song.cpp src/core/Track.cpp src/gui/TimeLineWidget.cpp
This commit is contained in:
200
src/CMakeLists.txt
Normal file
200
src/CMakeLists.txt
Normal file
@@ -0,0 +1,200 @@
|
||||
SET(LMMS_SRCS "")
|
||||
SET(LMMS_UIS "")
|
||||
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
ADD_SUBDIRECTORY(core)
|
||||
ADD_SUBDIRECTORY(gui)
|
||||
ADD_SUBDIRECTORY(tracks)
|
||||
|
||||
IF(QT5)
|
||||
QT5_WRAP_UI(LMMS_UI_OUT ${LMMS_UIS})
|
||||
ELSE()
|
||||
QT4_WRAP_UI(LMMS_UI_OUT ${LMMS_UIS})
|
||||
ENDIF()
|
||||
INCLUDE_DIRECTORIES(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_BINARY_DIR}/include"
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/include"
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
SET(WINRC "${CMAKE_BINARY_DIR}/lmmsrc.obj")
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${WINRC}"
|
||||
COMMAND "${WINDRES}"
|
||||
"-I\"${CMAKE_SOURCE_DIR}\""
|
||||
"-o\"${CMAKE_BINARY_DIR}/lmmsrc.obj\""
|
||||
"-i\"${CMAKE_BINARY_DIR}/lmms.rc\""
|
||||
DEPENDS "${CMAKE_BINARY_DIR}/lmms.rc")
|
||||
ENDIF()
|
||||
|
||||
SET(lmms_EMBEDDED_RESOURCES "${CMAKE_SOURCE_DIR}/AUTHORS" "${CMAKE_SOURCE_DIR}/COPYING" "${CONTRIBUTORS}")
|
||||
SET(LMMS_ER_H "${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h")
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${LMMS_ER_H}" COMMAND "${BIN2RES}" ARGS ${lmms_EMBEDDED_RESOURCES} > "\"${LMMS_ER_H}\"" DEPENDS bin2res)
|
||||
|
||||
# Paths relative to lmms executable
|
||||
FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}")
|
||||
FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}")
|
||||
ADD_DEFINITIONS(-D'LIB_DIR="${LIB_DIR_RELATIVE}/"' -D'PLUGIN_DIR="${PLUGIN_DIR_RELATIVE}/"' ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS})
|
||||
INCLUDE_DIRECTORIES(
|
||||
${JACK_INCLUDE_DIRS}
|
||||
${SAMPLERATE_INCLUDE_DIRS}
|
||||
${SNDFILE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
IF(NOT ("${SDL_INCLUDE_DIR}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES("${SDL_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${PORTAUDIO_INCLUDE_DIR}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES("${PORTAUDIO_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES("${PULSEAUDIO_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${OGGVORBIS_INCLUDE_DIR}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES("${OGGVORBIS_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
# Enable C++11
|
||||
ADD_DEFINITIONS("-std=c++0x")
|
||||
|
||||
# ADD_LIBRARY's OBJECT is only supported in CMake >=2.8.8
|
||||
IF(CMAKE_MAJOR_VERSION GREATER 2 OR
|
||||
CMAKE_MINOR_VERSION GREATER 8 OR
|
||||
CMAKE_PATCH_VERSION GREATER 7)
|
||||
|
||||
ADD_LIBRARY(lmmsobjs OBJECT
|
||||
${LMMS_SRCS}
|
||||
${LMMS_INCLUDES}
|
||||
${LMMS_UI_OUT}
|
||||
${LMMS_ER_H}
|
||||
)
|
||||
ADD_EXECUTABLE(lmms
|
||||
core/main.cpp
|
||||
$<TARGET_OBJECTS:lmmsobjs>
|
||||
"${WINRC}"
|
||||
)
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(lmms
|
||||
core/main.cpp
|
||||
${LMMS_SRCS}
|
||||
${LMMS_INCLUDES}
|
||||
${LMMS_UI_OUT}
|
||||
${LMMS_ER_H}
|
||||
"${WINRC}"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LMMS_ER_H} ${LMMS_UI_OUT} lmmsconfig.h lmms.1.gz")
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(EXTRA_LIBRARIES "-lwinmm")
|
||||
ENDIF()
|
||||
|
||||
SET(LMMS_REQUIRED_LIBS
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${QT_LIBRARIES}
|
||||
${ASOUND_LIBRARY}
|
||||
${SDL_LIBRARY}
|
||||
${PORTAUDIO_LIBRARIES}
|
||||
${PULSEAUDIO_LIBRARIES}
|
||||
${JACK_LIBRARIES}
|
||||
${OGGVORBIS_LIBRARIES}
|
||||
${SAMPLERATE_LIBRARIES}
|
||||
${SNDFILE_LIBRARIES}
|
||||
${EXTRA_LIBRARIES}
|
||||
)
|
||||
# Expose required libs for tests binary
|
||||
SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS} PARENT_SCOPE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(lmms
|
||||
${LMMS_REQUIRED_LIBS}
|
||||
)
|
||||
|
||||
IF(QT5)
|
||||
TARGET_LINK_LIBRARIES(lmms
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
|
||||
#
|
||||
# rules for building localizations
|
||||
#
|
||||
FILE(GLOB lmms_LOCALES ${CMAKE_SOURCE_DIR}/data/locale/*.ts)
|
||||
SET(ts_targets "")
|
||||
SET(qm_targets "")
|
||||
FOREACH(_ts_file ${lmms_LOCALES})
|
||||
STRING(REPLACE "${CMAKE_SOURCE_DIR}/data/locale/" "" _ts_target "${_ts_file}")
|
||||
STRING(REPLACE ".ts" ".qm" _qm_file "${_ts_file}")
|
||||
STRING(REPLACE ".ts" ".qm" _qm_target "${_ts_target}")
|
||||
ADD_CUSTOM_TARGET(${_ts_target}
|
||||
COMMAND "${QT_LUPDATE_EXECUTABLE}" -locations none -no-obsolete -I ${CMAKE_SOURCE_DIR}/include/ ${LMMS_SRCS} ${LMMS_INCLUDES} ${LMMS_UIS} `find "\"${CMAKE_SOURCE_DIR}/plugins/\"" -type f -name '*.cpp' -or -name '*.h'` -ts "\"${_ts_file}\""
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
ADD_CUSTOM_TARGET(${_qm_target}
|
||||
COMMAND "${QT_LRELEASE_EXECUTABLE}" "\"${_ts_file}\"" -qm "\"${_qm_file}\""
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
LIST(APPEND ts_targets "${_ts_target}")
|
||||
LIST(APPEND qm_targets "${_qm_target}")
|
||||
ENDFOREACH(_ts_file ${lmms_LOCALES})
|
||||
|
||||
ADD_CUSTOM_TARGET(update-locales)
|
||||
FOREACH(_item ${ts_targets})
|
||||
ADD_DEPENDENCIES(update-locales "${_item}")
|
||||
ENDFOREACH(_item ${ts_targets})
|
||||
|
||||
ADD_CUSTOM_TARGET(finalize-locales ALL)
|
||||
FOREACH(_item ${qm_targets})
|
||||
ADD_DEPENDENCIES(finalize-locales "${_item}")
|
||||
ENDFOREACH(_item ${qm_targets})
|
||||
|
||||
# Install
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET_TARGET_PROPERTIES(lmms PROPERTIES
|
||||
LINK_FLAGS "${LINK_FLAGS} -mwindows"
|
||||
ENABLE_EXPORTS ON
|
||||
)
|
||||
ADD_CUSTOM_COMMAND(TARGET lmms POST_BUILD COMMAND "${STRIP}" "$<TARGET_FILE:lmms>")
|
||||
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}")
|
||||
INSTALL(FILES
|
||||
"${MINGW_PREFIX}/bin/QtCore4.dll"
|
||||
"${MINGW_PREFIX}/bin/QtGui4.dll"
|
||||
"${MINGW_PREFIX}/bin/QtSvg4.dll"
|
||||
"${MINGW_PREFIX}/bin/QtXml4.dll"
|
||||
"${MINGW_PREFIX}/bin/libsamplerate-0.dll"
|
||||
"${MINGW_PREFIX}/bin/libsndfile-1.dll"
|
||||
"${MINGW_PREFIX}/bin/libvorbis-0.dll"
|
||||
"${MINGW_PREFIX}/bin/libvorbisenc-2.dll"
|
||||
"${MINGW_PREFIX}/bin/libvorbisfile-3.dll"
|
||||
"${MINGW_PREFIX}/bin/libjpeg-9.dll"
|
||||
"${MINGW_PREFIX}/bin/libogg-0.dll"
|
||||
"${MINGW_PREFIX}/lib/libfltk.dll"
|
||||
"${MINGW_PREFIX}/bin/libfluidsynth.dll"
|
||||
"${MINGW_PREFIX}/bin/libfftw3f-3.dll"
|
||||
"${MINGW_PREFIX}/bin/libFLAC-8.dll"
|
||||
"${MINGW_PREFIX}/bin/libportaudio-2.dll"
|
||||
"${MINGW_PREFIX}/bin/libpng16-16.dll"
|
||||
"${MINGW_PREFIX}/bin/SDL.dll"
|
||||
"${MINGW_PREFIX}/bin/libglib-2.0-0.dll"
|
||||
"${MINGW_PREFIX}/bin/libgthread-2.0-0.dll"
|
||||
"${MINGW_PREFIX}/bin/zlib1.dll"
|
||||
"${MINGW_PREFIX}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/bin/libwinpthread-1.dll"
|
||||
DESTINATION .)
|
||||
|
||||
ELSE(LMMS_BUILD_WIN32)
|
||||
IF(NOT LMMS_BUILD_APPLE)
|
||||
SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -Wl,-E")
|
||||
ENDIF(NOT LMMS_BUILD_APPLE)
|
||||
|
||||
INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}")
|
||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/lmms.1.gz" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
|
||||
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
@@ -25,12 +25,9 @@
|
||||
*/
|
||||
|
||||
#include <QDomElement>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
#include "AutomationPattern.h"
|
||||
#include "AutomationPatternView.h"
|
||||
#include "AutomationEditor.h"
|
||||
#include "AutomationTrack.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "BBTrackContainer.h"
|
||||
@@ -38,7 +35,7 @@
|
||||
#include "TextFloat.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
int AutomationPattern::s_quantization = 1;
|
||||
const float AutomationPattern::DEFAULT_MIN_VALUE = 0;
|
||||
const float AutomationPattern::DEFAULT_MAX_VALUE = 1;
|
||||
|
||||
@@ -54,6 +51,21 @@ AutomationPattern::AutomationPattern( AutomationTrack * _auto_track ) :
|
||||
m_lastRecordedValue( 0 )
|
||||
{
|
||||
changeLength( MidiTime( 1, 0 ) );
|
||||
if( getTrack() )
|
||||
{
|
||||
switch( getTrack()->trackContainer()->type() )
|
||||
{
|
||||
case TrackContainer::BBContainer:
|
||||
setAutoResize( true );
|
||||
break;
|
||||
|
||||
case TrackContainer::SongContainer:
|
||||
// move down
|
||||
default:
|
||||
setAutoResize( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +84,18 @@ AutomationPattern::AutomationPattern( const AutomationPattern & _pat_to_copy ) :
|
||||
m_timeMap[it.key()] = it.value();
|
||||
m_tangents[it.key()] = _pat_to_copy.m_tangents[it.key()];
|
||||
}
|
||||
switch( getTrack()->trackContainer()->type() )
|
||||
{
|
||||
case TrackContainer::BBContainer:
|
||||
setAutoResize( true );
|
||||
break;
|
||||
|
||||
case TrackContainer::SongContainer:
|
||||
// move down
|
||||
default:
|
||||
setAutoResize( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,11 +103,6 @@ AutomationPattern::AutomationPattern( const AutomationPattern & _pat_to_copy ) :
|
||||
|
||||
AutomationPattern::~AutomationPattern()
|
||||
{
|
||||
if( Engine::automationEditor() &&
|
||||
Engine::automationEditor()->currentPattern() == this )
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -186,16 +205,15 @@ MidiTime AutomationPattern::putValue( const MidiTime & _time,
|
||||
{
|
||||
cleanObjects();
|
||||
|
||||
MidiTime newTime = _quant_pos && Engine::automationEditor() ?
|
||||
Note::quantized( _time,
|
||||
Engine::automationEditor()->quantization() ) :
|
||||
_time;
|
||||
MidiTime newTime = _quant_pos ?
|
||||
Note::quantized( _time, quantization() ) :
|
||||
_time;
|
||||
|
||||
m_timeMap[newTime] = _value;
|
||||
timeMap::const_iterator it = m_timeMap.find( newTime );
|
||||
if( it != m_timeMap.begin() )
|
||||
{
|
||||
it--;
|
||||
--it;
|
||||
}
|
||||
generateTangents(it, 3);
|
||||
|
||||
@@ -219,17 +237,16 @@ void AutomationPattern::removeValue( const MidiTime & _time,
|
||||
{
|
||||
cleanObjects();
|
||||
|
||||
MidiTime newTime = _quant_pos && Engine::automationEditor() ?
|
||||
Note::quantized( _time,
|
||||
Engine::automationEditor()->quantization() ) :
|
||||
_time;
|
||||
MidiTime newTime = _quant_pos ?
|
||||
Note::quantized( _time, quantization() ) :
|
||||
_time;
|
||||
|
||||
m_timeMap.remove( newTime );
|
||||
m_tangents.remove( newTime );
|
||||
timeMap::const_iterator it = m_timeMap.lowerBound( newTime );
|
||||
if( it != m_timeMap.begin() )
|
||||
{
|
||||
it--;
|
||||
--it;
|
||||
}
|
||||
generateTangents(it, 3);
|
||||
|
||||
@@ -259,10 +276,9 @@ MidiTime AutomationPattern::setDragValue( const MidiTime & _time, const float _v
|
||||
{
|
||||
if( m_dragging == false )
|
||||
{
|
||||
MidiTime newTime = _quant_pos && Engine::automationEditor() ?
|
||||
Note::quantized( _time,
|
||||
Engine::automationEditor()->quantization() ) :
|
||||
_time;
|
||||
MidiTime newTime = _quant_pos ?
|
||||
Note::quantized( _time, quantization() ) :
|
||||
_time;
|
||||
this->removeValue( newTime );
|
||||
m_oldTimeMap = m_timeMap;
|
||||
m_dragging = true;
|
||||
@@ -271,7 +287,7 @@ MidiTime AutomationPattern::setDragValue( const MidiTime & _time, const float _v
|
||||
//Restore to the state before it the point were being dragged
|
||||
m_timeMap = m_oldTimeMap;
|
||||
|
||||
for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); it++ )
|
||||
for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); ++it )
|
||||
{
|
||||
generateTangents(it, 3);
|
||||
}
|
||||
@@ -413,9 +429,15 @@ void AutomationPattern::flipY( int min, int max )
|
||||
}
|
||||
|
||||
generateTangents();
|
||||
Engine::automationEditor()->update();
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomationPattern::flipY()
|
||||
{
|
||||
flipY(getMin(), getMax());
|
||||
}
|
||||
|
||||
|
||||
@@ -446,23 +468,15 @@ void AutomationPattern::flipX( int length )
|
||||
for( int i = 0; i <= numPoints; i++ )
|
||||
{
|
||||
tempValue = valueAt( ( iterate + i ).key() );
|
||||
cleanObjects();
|
||||
MidiTime newTime = MidiTime( length - ( iterate + i ).key() );
|
||||
tempMap[newTime] = tempValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//for ( int i = 0; ( iterate + i ).key() < length ; i++ )
|
||||
//{
|
||||
// tempValue = valueAt( ( iterate + i ).key() );
|
||||
//}
|
||||
//putValue( MidiTime( length ) , tempValue, false);
|
||||
//numPoints++;
|
||||
for( int i = 0; i <= numPoints; i++ )
|
||||
{
|
||||
tempValue = valueAt( ( iterate + i ).key() );
|
||||
cleanObjects();
|
||||
MidiTime newTime;
|
||||
|
||||
if ( ( iterate + i ).key() <= length )
|
||||
@@ -493,7 +507,6 @@ void AutomationPattern::flipX( int length )
|
||||
m_timeMap = tempMap;
|
||||
|
||||
generateTangents();
|
||||
Engine::automationEditor()->update();
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
@@ -791,22 +804,6 @@ void AutomationPattern::clear()
|
||||
m_tangents.clear();
|
||||
|
||||
emit dataChanged();
|
||||
|
||||
if( Engine::automationEditor() &&
|
||||
Engine::automationEditor()->currentPattern() == this )
|
||||
{
|
||||
Engine::automationEditor()->update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomationPattern::openInAutomationEditor()
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( this );
|
||||
Engine::automationEditor()->parentWidget()->show();
|
||||
Engine::automationEditor()->setFocus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ BBTrackContainer::BBTrackContainer() :
|
||||
// not change upon setCurrentBB()-call
|
||||
connect( &m_bbComboBoxModel, SIGNAL( dataUnchanged() ),
|
||||
this, SLOT( currentBBChanged() ) );
|
||||
setType( BBContainer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
87
src/core/CMakeLists.txt
Normal file
87
src/core/CMakeLists.txt
Normal file
@@ -0,0 +1,87 @@
|
||||
set(LMMS_SRCS
|
||||
${LMMS_SRCS}
|
||||
core/AutomatableModel.cpp
|
||||
core/AutomationPattern.cpp
|
||||
core/BandLimitedWave.cpp
|
||||
core/base64.cpp
|
||||
core/BBTrackContainer.cpp
|
||||
core/BufferManager.cpp
|
||||
core/Clipboard.cpp
|
||||
core/ComboBoxModel.cpp
|
||||
core/ConfigManager.cpp
|
||||
core/Controller.cpp
|
||||
core/ControllerConnection.cpp
|
||||
core/DataFile.cpp
|
||||
core/DrumSynth.cpp
|
||||
core/Effect.cpp
|
||||
core/EffectChain.cpp
|
||||
core/Engine.cpp
|
||||
core/EnvelopeAndLfoParameters.cpp
|
||||
core/fft_helpers.cpp
|
||||
core/FxMixer.cpp
|
||||
core/ImportFilter.cpp
|
||||
core/InlineAutomation.cpp
|
||||
core/Instrument.cpp
|
||||
core/InstrumentFunctions.cpp
|
||||
core/InstrumentPlayHandle.cpp
|
||||
core/InstrumentSoundShaping.cpp
|
||||
core/JournallingObject.cpp
|
||||
core/Ladspa2LMMS.cpp
|
||||
core/LadspaControl.cpp
|
||||
core/LadspaManager.cpp
|
||||
core/LfoController.cpp
|
||||
core/MemoryHelper.cpp
|
||||
core/MemoryManager.cpp
|
||||
core/MeterModel.cpp
|
||||
core/Mixer.cpp
|
||||
core/MixerProfiler.cpp
|
||||
core/MixerWorkerThread.cpp
|
||||
core/MixHelpers.cpp
|
||||
core/Model.cpp
|
||||
core/Note.cpp
|
||||
core/NotePlayHandle.cpp
|
||||
core/Oscillator.cpp
|
||||
core/PeakController.cpp
|
||||
core/Piano.cpp
|
||||
core/PlayHandle.cpp
|
||||
core/Plugin.cpp
|
||||
core/PresetPreviewPlayHandle.cpp
|
||||
core/ProjectJournal.cpp
|
||||
core/ProjectRenderer.cpp
|
||||
core/ProjectVersion.cpp
|
||||
core/RemotePlugin.cpp
|
||||
core/RingBuffer.cpp
|
||||
core/SampleBuffer.cpp
|
||||
core/SamplePlayHandle.cpp
|
||||
core/SampleRecordHandle.cpp
|
||||
core/SerializingObject.cpp
|
||||
core/Song.cpp
|
||||
core/TempoSyncKnobModel.cpp
|
||||
core/ToolPlugin.cpp
|
||||
core/Track.cpp
|
||||
core/TrackContainer.cpp
|
||||
core/VstSyncController.cpp
|
||||
|
||||
core/audio/AudioAlsa.cpp
|
||||
core/audio/AudioDevice.cpp
|
||||
core/audio/AudioFileDevice.cpp
|
||||
core/audio/AudioFileOgg.cpp
|
||||
core/audio/AudioFileWave.cpp
|
||||
core/audio/AudioJack.cpp
|
||||
core/audio/AudioOss.cpp
|
||||
core/audio/AudioPort.cpp
|
||||
core/audio/AudioPortAudio.cpp
|
||||
core/audio/AudioPulseAudio.cpp
|
||||
core/audio/AudioSampleRecorder.cpp
|
||||
core/audio/AudioSdl.cpp
|
||||
|
||||
core/midi/MidiAlsaRaw.cpp
|
||||
core/midi/MidiAlsaSeq.cpp
|
||||
core/midi/MidiClient.cpp
|
||||
core/midi/MidiController.cpp
|
||||
core/midi/MidiOss.cpp
|
||||
core/midi/MidiPort.cpp
|
||||
core/midi/MidiWinMM.cpp
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -248,10 +248,18 @@ bool DataFile::writeFile( const QString& filename )
|
||||
// make sure the file has been written correctly
|
||||
if( QFileInfo( outfile.fileName() ).size() > 0 )
|
||||
{
|
||||
// remove old backup file
|
||||
QFile::remove( fullNameBak );
|
||||
// move current file to backup file
|
||||
QFile::rename( fullName, fullNameBak );
|
||||
if( ConfigManager::inst()->value( "app", "disablebackup" ).toInt() )
|
||||
{
|
||||
// remove current file
|
||||
QFile::remove( fullName );
|
||||
}
|
||||
else
|
||||
{
|
||||
// remove old backup file
|
||||
QFile::remove( fullNameBak );
|
||||
// move current file to backup file
|
||||
QFile::rename( fullName, fullNameBak );
|
||||
}
|
||||
// move temporary file to current file
|
||||
QFile::rename( fullNameTemp, fullName );
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b
|
||||
it = m_effects.end()-1;
|
||||
printf( "numerical overflow after processing "
|
||||
"plugin \"%s\"\n", ( *it )->
|
||||
publicName().toUtf8().constData() );
|
||||
descriptor()->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,55 +24,37 @@
|
||||
|
||||
|
||||
#include "Engine.h"
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Ladspa2LMMS.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Mixer.h"
|
||||
#include "Pattern.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "PresetPreviewPlayHandle.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "ProjectNotes.h"
|
||||
#include "Plugin.h"
|
||||
#include "SongEditor.h"
|
||||
#include "Song.h"
|
||||
#include "BandLimitedWave.h"
|
||||
|
||||
#include "GuiApplication.h"
|
||||
|
||||
bool Engine::s_hasGUI = true;
|
||||
bool Engine::s_suppressMessages = false;
|
||||
float Engine::s_framesPerTick;
|
||||
Mixer* Engine::s_mixer = NULL;
|
||||
FxMixer * Engine::s_fxMixer = NULL;
|
||||
FxMixerView * Engine::s_fxMixerView = NULL;
|
||||
MainWindow * Engine::s_mainWindow = NULL;
|
||||
BBTrackContainer * Engine::s_bbTrackContainer = NULL;
|
||||
Song * Engine::s_song = NULL;
|
||||
SongEditor* Engine::s_songEditor = NULL;
|
||||
AutomationEditor * Engine::s_automationEditor = NULL;
|
||||
BBEditor * Engine::s_bbEditor = NULL;
|
||||
PianoRoll* Engine::s_pianoRoll = NULL;
|
||||
ProjectNotes * Engine::s_projectNotes = NULL;
|
||||
ProjectJournal * Engine::s_projectJournal = NULL;
|
||||
Ladspa2LMMS * Engine::s_ladspaManager = NULL;
|
||||
DummyTrackContainer * Engine::s_dummyTC = NULL;
|
||||
ControllerRackView * Engine::s_controllerRackView = NULL;
|
||||
QMap<QString, QString> Engine::s_pluginFileHandling;
|
||||
|
||||
|
||||
|
||||
|
||||
void Engine::init( const bool _has_gui )
|
||||
void Engine::init()
|
||||
{
|
||||
s_hasGUI = _has_gui;
|
||||
|
||||
// generate (load from file) bandlimited wavetables
|
||||
BandLimitedWave::generateWaves();
|
||||
|
||||
@@ -90,20 +72,6 @@ void Engine::init( const bool _has_gui )
|
||||
|
||||
s_mixer->initDevices();
|
||||
|
||||
if( s_hasGUI )
|
||||
{
|
||||
s_mainWindow = new MainWindow;
|
||||
s_songEditor = new SongEditor( s_song );
|
||||
s_fxMixerView = new FxMixerView;
|
||||
s_controllerRackView = new ControllerRackView;
|
||||
s_projectNotes = new ProjectNotes;
|
||||
s_bbEditor = new BBEditor( s_bbTrackContainer );
|
||||
s_pianoRoll = new PianoRoll;
|
||||
s_automationEditor = new AutomationEditor;
|
||||
|
||||
s_mainWindow->finalize();
|
||||
}
|
||||
|
||||
PresetPreviewPlayHandle::init();
|
||||
s_dummyTC = new DummyTrackContainer;
|
||||
|
||||
@@ -118,15 +86,7 @@ void Engine::destroy()
|
||||
s_projectJournal->stopAllJournalling();
|
||||
s_mixer->stopProcessing();
|
||||
|
||||
deleteHelper( &s_projectNotes );
|
||||
deleteHelper( &s_songEditor );
|
||||
deleteHelper( &s_bbEditor );
|
||||
deleteHelper( &s_pianoRoll );
|
||||
deleteHelper( &s_automationEditor );
|
||||
deleteHelper( &s_fxMixerView );
|
||||
|
||||
PresetPreviewPlayHandle::cleanup();
|
||||
InstrumentTrackView::cleanupWindowCache();
|
||||
|
||||
s_song->clearProject();
|
||||
|
||||
@@ -141,13 +101,16 @@ void Engine::destroy()
|
||||
//delete ConfigManager::inst();
|
||||
deleteHelper( &s_projectJournal );
|
||||
|
||||
s_mainWindow = NULL;
|
||||
|
||||
deleteHelper( &s_song );
|
||||
|
||||
delete ConfigManager::inst();
|
||||
}
|
||||
|
||||
bool Engine::hasGUI()
|
||||
{
|
||||
return gui != nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ int FxMixer::createChannel()
|
||||
|
||||
void FxMixer::activateSolo()
|
||||
{
|
||||
for (int i = 0; i < m_fxChannels.size(); ++i)
|
||||
for (int i = 1; i < m_fxChannels.size(); ++i)
|
||||
{
|
||||
m_fxChannels[i]->m_muteBeforeSolo = m_fxChannels[i]->m_muteModel.value();
|
||||
m_fxChannels[i]->m_muteModel.setValue( true );
|
||||
@@ -239,7 +239,7 @@ void FxMixer::activateSolo()
|
||||
|
||||
void FxMixer::deactivateSolo()
|
||||
{
|
||||
for (int i = 0; i < m_fxChannels.size(); ++i)
|
||||
for (int i = 1; i < m_fxChannels.size(); ++i)
|
||||
{
|
||||
m_fxChannels[i]->m_muteModel.setValue( m_fxChannels[i]->m_muteBeforeSolo );
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ Ladspa2LMMS::Ladspa2LMMS()
|
||||
l_sortable_plugin_t plugins = getSortedPlugins();
|
||||
|
||||
for( l_sortable_plugin_t::iterator it = plugins.begin();
|
||||
it != plugins.end(); it++ )
|
||||
it != plugins.end(); ++it )
|
||||
{
|
||||
ladspa_key_t key = (*it).second;
|
||||
ladspaManagerDescription * desc = getDescription( key );
|
||||
|
||||
@@ -96,7 +96,7 @@ LadspaManager::LadspaManager()
|
||||
|
||||
l_ladspa_key_t keys = m_ladspaManagerMap.keys();
|
||||
for( l_ladspa_key_t::iterator it = keys.begin();
|
||||
it != keys.end(); it++ )
|
||||
it != keys.end(); ++it )
|
||||
{
|
||||
m_sortedPlugins.append( qMakePair( getName( *it ), *it ) );
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "Engine.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "SamplePlayHandle.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "PianoRoll.h"
|
||||
|
||||
// platform-specific audio-interface-classes
|
||||
@@ -323,7 +324,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
Song::PlayPos p = Engine::getSong()->getPlayPos(
|
||||
Song::Mode_PlayPattern );
|
||||
if( Engine::getSong()->playMode() == Song::Mode_PlayPattern &&
|
||||
Engine::pianoRoll()->isRecording() == true &&
|
||||
gui->pianoRoll()->isRecording() == true &&
|
||||
p != last_metro_pos )
|
||||
{
|
||||
if ( p.getTicks() % (MidiTime::ticksPerTact() / 1 ) == 0 )
|
||||
|
||||
@@ -209,14 +209,6 @@ void Note::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void Note::editDetuningPattern()
|
||||
{
|
||||
createDetuning();
|
||||
m_detuning->automationPattern()->openInAutomationEditor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Note::createDetuning()
|
||||
{
|
||||
|
||||
@@ -509,10 +509,11 @@ bool NotePlayHandle::operator==( const NotePlayHandle & _nph ) const
|
||||
|
||||
void NotePlayHandle::updateFrequency()
|
||||
{
|
||||
int mp = m_instrumentTrack->m_useMasterPitchModel.value() ? Engine::getSong()->masterPitch() : 0;
|
||||
const float pitch =
|
||||
( key() -
|
||||
m_instrumentTrack->baseNoteModel()->value() +
|
||||
Engine::getSong()->masterPitch() +
|
||||
mp +
|
||||
m_baseDetuning->value() )
|
||||
/ 12.0f;
|
||||
m_frequency = BaseFreq * powf( 2.0f, pitch + m_instrumentTrack->pitchModel()->value() / ( 100 * 12.0f ) );
|
||||
|
||||
@@ -30,11 +30,12 @@
|
||||
#include "Plugin.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "Mixer.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "DummyPlugin.h"
|
||||
#include "AutomatableModel.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
static PixmapLoader __dummyLoader;
|
||||
@@ -130,7 +131,11 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent,
|
||||
|
||||
void Plugin::collectErrorForUI( QString errMsg )
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
Engine::mainWindow()->collectError( errMsg );
|
||||
=======
|
||||
Engine::getSong()->collectError( errMsg );
|
||||
>>>>>>> coding
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,8 +126,6 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file,
|
||||
const bool j = Engine::projectJournal()->isJournalling();
|
||||
Engine::projectJournal()->setJournalling( false );
|
||||
|
||||
Engine::setSuppressMessages( true );
|
||||
|
||||
if( _load_by_plugin )
|
||||
{
|
||||
Instrument * i = s_previewTC->previewInstrumentTrack()->instrument();
|
||||
@@ -147,13 +145,21 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file,
|
||||
else
|
||||
{
|
||||
DataFile dataFile( _preset_file );
|
||||
s_previewTC->previewInstrumentTrack()->
|
||||
loadTrackSpecificSettings(
|
||||
dataFile.content().firstChild().toElement() );
|
||||
// vestige previews are bug prone; fallback on 3xosc with volume of 0
|
||||
// without an instrument in preview track, it will segfault
|
||||
if(dataFile.content().elementsByTagName( "vestige" ).length() == 0 )
|
||||
{
|
||||
s_previewTC->previewInstrumentTrack()->
|
||||
loadTrackSpecificSettings(
|
||||
dataFile.content().firstChild().toElement() );
|
||||
}
|
||||
else
|
||||
{
|
||||
s_previewTC->previewInstrumentTrack()->loadInstrument("tripleoscillator");
|
||||
s_previewTC->previewInstrumentTrack()->setVolume( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
Engine::setSuppressMessages( false );
|
||||
|
||||
// make sure, our preset-preview-track does not appear in any MIDI-
|
||||
// devices list, so just disable receiving/sending MIDI-events at all
|
||||
s_previewTC->previewInstrumentTrack()->
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2015 Tres Finocchiaro <tres.finocchiaro/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,57 +25,122 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include "ProjectVersion.h"
|
||||
|
||||
int parseMajor(QString & version) {
|
||||
return version.section( '.', 0, 0 ).toInt();
|
||||
}
|
||||
|
||||
int parseMinor(QString & version) {
|
||||
return version.section( '.', 1, 1 ).toInt();
|
||||
}
|
||||
|
||||
int parseRelease(QString & version) {
|
||||
return version.section( '.', 2 ).section( '-', 0, 0 ).toInt();
|
||||
}
|
||||
|
||||
QString parseBuild(QString & version) {
|
||||
return version.section( '.', 2 ).section( '-', 1 );
|
||||
}
|
||||
|
||||
ProjectVersion::ProjectVersion(QString version, CompareType c) :
|
||||
m_version(version),
|
||||
m_major(parseMajor(m_version)),
|
||||
m_minor(parseMinor(m_version)),
|
||||
m_release(parseRelease(m_version)) ,
|
||||
m_build(parseBuild(m_version)),
|
||||
m_compareType(c)
|
||||
{
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
int ProjectVersion::compare( const ProjectVersion & v1,
|
||||
const ProjectVersion & v2 )
|
||||
=======
|
||||
ProjectVersion::ProjectVersion( const char* version, CompareType c ) :
|
||||
m_version( QString( version ) ),
|
||||
m_major(parseMajor( m_version ) ),
|
||||
m_minor(parseMinor( m_version ) ),
|
||||
m_release(parseRelease( m_version ) ),
|
||||
m_build(parseBuild( m_version ) ),
|
||||
m_compareType( c )
|
||||
>>>>>>> coding
|
||||
{
|
||||
int n1, n2;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Major
|
||||
n1 = v1.section( '.', 0, 0 ).toInt();
|
||||
n2 = v2.section( '.', 0, 0 ).toInt();
|
||||
if( n1 != n2 )
|
||||
=======
|
||||
int ProjectVersion::compare( const ProjectVersion & a, const ProjectVersion & b, CompareType c )
|
||||
{
|
||||
if( a.getMajor() != b.getMajor() )
|
||||
>>>>>>> coding
|
||||
{
|
||||
return n1 - n2;
|
||||
return a.getMajor() - b.getMajor();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
// Minor
|
||||
n1 = v1.section( '.', 1, 1 ).toInt();
|
||||
n2 = v2.section( '.', 1, 1 ).toInt();
|
||||
if( n1 != n2 )
|
||||
=======
|
||||
else if( c == CompareType::Major )
|
||||
>>>>>>> coding
|
||||
{
|
||||
return n1 - n2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Release
|
||||
n1 = v1.section( '.', 2 ).section( '-', 0, 0 ).toInt();
|
||||
n2 = v2.section( '.', 2 ).section( '-', 0, 0 ).toInt();
|
||||
if( n1 != n2 )
|
||||
=======
|
||||
if( a.getMinor() != b.getMinor() )
|
||||
{
|
||||
return n1 - n2;
|
||||
return a.getMinor() - b.getMinor();
|
||||
}
|
||||
else if( c == CompareType::Minor )
|
||||
>>>>>>> coding
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Build
|
||||
const QString b1 = v1.section( '.', 2 ).section( '-', 1 );
|
||||
const QString b2 = v2.section( '.', 2 ).section( '-', 1 );
|
||||
=======
|
||||
if( a.getRelease() != b.getRelease() )
|
||||
{
|
||||
return a.getRelease() - b.getRelease();
|
||||
}
|
||||
else if( c == CompareType::Release )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
>>>>>>> coding
|
||||
|
||||
// make sure 0.x.y > 0.x.y-patch
|
||||
if( b1.isEmpty() )
|
||||
if( a.getBuild().isEmpty() )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( b2.isEmpty() )
|
||||
if( b.getBuild().isEmpty() )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return QString::compare( b1, b2 );
|
||||
return QString::compare( a.getBuild(), b.getBuild() );
|
||||
}
|
||||
|
||||
int ProjectVersion::compare( ProjectVersion v1, ProjectVersion v2 )
|
||||
{
|
||||
return compare( v1, v2, std::min( v1.getCompareType(), v2.getCompareType() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void RingBuffer::changeSize( f_cnt_t size )
|
||||
m_buffer = new sampleFrame[ m_size ];
|
||||
memset( m_buffer, 0, m_size * sizeof( sampleFrame ) );
|
||||
m_position = 0;
|
||||
delete tmp;
|
||||
delete[] tmp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,14 +98,15 @@ SamplePlayHandle::~SamplePlayHandle()
|
||||
|
||||
void SamplePlayHandle::play( sampleFrame * buffer )
|
||||
{
|
||||
const fpp_t fpp = Engine::mixer()->framesPerPeriod();
|
||||
//play( 0, _try_parallelizing );
|
||||
if( framesDone() >= totalFrames() )
|
||||
{
|
||||
memset( buffer, 0, sizeof( sampleFrame ) * fpp );
|
||||
return;
|
||||
}
|
||||
|
||||
sampleFrame * workingBuffer = buffer;
|
||||
const fpp_t fpp = Engine::mixer()->framesPerPeriod();
|
||||
f_cnt_t frames = fpp;
|
||||
|
||||
// apply offset for the first period
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "Pattern.h"
|
||||
#include "SampleBuffer.h"
|
||||
#include "SampleTrack.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) :
|
||||
@@ -116,9 +116,9 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf )
|
||||
// make sure buffer is cleaned up properly at the end...
|
||||
sampleFrame * data_ptr = data;
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
|
||||
assert( data != NULL );
|
||||
#endif
|
||||
|
||||
// now copy all buffers into big buffer
|
||||
for( bufferList::const_iterator it = m_buffers.begin();
|
||||
it != m_buffers.end(); ++it )
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Song.h"
|
||||
#include <QTextStream>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
@@ -30,7 +32,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "Song.h"
|
||||
#include "AutomationTrack.h"
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
@@ -44,6 +45,7 @@
|
||||
#include "ExportProjectDialog.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -60,7 +62,7 @@
|
||||
#include "SongEditor.h"
|
||||
#include "templates.h"
|
||||
#include "TextFloat.h"
|
||||
#include "Timeline.h"
|
||||
#include "TimeLineWidget.h"
|
||||
#include "PeakController.h"
|
||||
|
||||
|
||||
@@ -88,6 +90,7 @@ Song::Song() :
|
||||
m_playing( false ),
|
||||
m_paused( false ),
|
||||
m_loadingProject( false ),
|
||||
m_errors( new QList<QString>() ),
|
||||
m_playMode( Mode_None ),
|
||||
m_length( 0 ),
|
||||
m_trackToPlay( NULL ),
|
||||
@@ -114,6 +117,7 @@ Song::Song() :
|
||||
this, SLOT( masterPitchChanged() ) );*/
|
||||
|
||||
qRegisterMetaType<Note>( "note" );
|
||||
setType( SongContainer );
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +185,7 @@ void Song::setTimeSignature()
|
||||
|
||||
void Song::savePos()
|
||||
{
|
||||
Timeline * tl = m_playPos[m_playMode].m_timeLine;
|
||||
TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine;
|
||||
|
||||
if( tl != NULL )
|
||||
{
|
||||
@@ -248,9 +252,16 @@ void Song::processNextBuffer()
|
||||
}
|
||||
|
||||
// check for looping-mode and act if necessary
|
||||
<<<<<<< HEAD
|
||||
Timeline * tl = m_playPos[m_playMode].m_timeLine;
|
||||
bool checkLoop = tl != NULL && m_exporting == false &&
|
||||
tl->loopPointsEnabled();
|
||||
=======
|
||||
TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine;
|
||||
bool checkLoop = tl != NULL && m_exporting == false &&
|
||||
tl->loopPointsEnabled();
|
||||
|
||||
>>>>>>> coding
|
||||
if( checkLoop )
|
||||
{
|
||||
if( m_playPos[m_playMode] < tl->loopBegin() ||
|
||||
@@ -601,7 +612,7 @@ void Song::stop()
|
||||
return;
|
||||
}
|
||||
|
||||
Timeline * tl = m_playPos[m_playMode].m_timeLine;
|
||||
TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine;
|
||||
m_playing = false;
|
||||
m_paused = false;
|
||||
m_recording = true;
|
||||
@@ -611,12 +622,12 @@ void Song::stop()
|
||||
|
||||
switch( tl->behaviourAtStop() )
|
||||
{
|
||||
case Timeline::BackToZero:
|
||||
case TimeLineWidget::BackToZero:
|
||||
m_playPos[m_playMode].setTicks( 0 );
|
||||
m_elapsedMilliSeconds = 0;
|
||||
break;
|
||||
|
||||
case Timeline::BackToStart:
|
||||
case TimeLineWidget::BackToStart:
|
||||
if( tl->savedPos() >= 0 )
|
||||
{
|
||||
m_playPos[m_playMode].setTicks( tl->savedPos().getTicks() );
|
||||
@@ -627,7 +638,7 @@ void Song::stop()
|
||||
}
|
||||
break;
|
||||
|
||||
case Timeline::KeepStopPosition:
|
||||
case TimeLineWidget::KeepStopPosition:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -773,17 +784,18 @@ void Song::clearProject()
|
||||
|
||||
|
||||
Engine::mixer()->lock();
|
||||
if( Engine::getBBEditor() )
|
||||
|
||||
if( gui && gui->getBBEditor() )
|
||||
{
|
||||
Engine::getBBEditor()->clearAllTracks();
|
||||
gui->getBBEditor()->trackContainerView()->clearAllTracks();
|
||||
}
|
||||
if( Engine::songEditor() )
|
||||
if( gui && gui->songEditor() )
|
||||
{
|
||||
Engine::songEditor()->clearAllTracks();
|
||||
gui->songEditor()->m_editor->clearAllTracks();
|
||||
}
|
||||
if( Engine::fxMixerView() )
|
||||
if( gui && gui->fxMixerView() )
|
||||
{
|
||||
Engine::fxMixerView()->clear();
|
||||
gui->fxMixerView()->clear();
|
||||
}
|
||||
QCoreApplication::sendPostedEvents();
|
||||
Engine::getBBTrackContainer()->clearAllTracks();
|
||||
@@ -791,14 +803,14 @@ void Song::clearProject()
|
||||
|
||||
Engine::fxMixer()->clear();
|
||||
|
||||
if( Engine::automationEditor() )
|
||||
if( gui && gui->automationEditor() )
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( NULL );
|
||||
gui->automationEditor()->setCurrentPattern( NULL );
|
||||
}
|
||||
|
||||
if( Engine::pianoRoll() )
|
||||
if( gui && gui->pianoRoll() )
|
||||
{
|
||||
Engine::pianoRoll()->reset();
|
||||
gui->pianoRoll()->reset();
|
||||
}
|
||||
|
||||
m_tempoModel.reset();
|
||||
@@ -814,9 +826,9 @@ void Song::clearProject()
|
||||
|
||||
Engine::mixer()->unlock();
|
||||
|
||||
if( Engine::getProjectNotes() )
|
||||
if( gui && gui->getProjectNotes() )
|
||||
{
|
||||
Engine::getProjectNotes()->clear();
|
||||
gui->getProjectNotes()->clear();
|
||||
}
|
||||
|
||||
// Move to function
|
||||
@@ -894,9 +906,9 @@ void Song::createNewProject()
|
||||
|
||||
m_modified = false;
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,9 +922,9 @@ void Song::createNewProjectFromTemplate( const QString & templ )
|
||||
// saving...
|
||||
m_fileName = m_oldFileName = "";
|
||||
// update window title
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -928,10 +940,6 @@ void Song::loadProject( const QString & fileName )
|
||||
m_loadingProject = true;
|
||||
|
||||
Engine::projectJournal()->setJournalling( false );
|
||||
if( Engine::mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->clearErrors();
|
||||
}
|
||||
|
||||
m_fileName = fileName;
|
||||
m_oldFileName = fileName;
|
||||
@@ -946,6 +954,8 @@ void Song::loadProject( const QString & fileName )
|
||||
|
||||
clearProject();
|
||||
|
||||
clearErrors();
|
||||
|
||||
DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeLoad );
|
||||
|
||||
Engine::mixer()->lock();
|
||||
@@ -979,7 +989,7 @@ void Song::loadProject( const QString & fileName )
|
||||
if( Engine::hasGUI() )
|
||||
{
|
||||
// refresh FxMixerView
|
||||
Engine::fxMixerView()->refreshDisplay();
|
||||
gui->fxMixerView()->refreshDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -998,21 +1008,21 @@ void Song::loadProject( const QString & fileName )
|
||||
}
|
||||
else if( Engine::hasGUI() )
|
||||
{
|
||||
if( node.nodeName() == Engine::getControllerRackView()->nodeName() )
|
||||
if( node.nodeName() == gui->getControllerRackView()->nodeName() )
|
||||
{
|
||||
Engine::getControllerRackView()->restoreState( node.toElement() );
|
||||
gui->getControllerRackView()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::pianoRoll()->nodeName() )
|
||||
else if( node.nodeName() == gui->pianoRoll()->nodeName() )
|
||||
{
|
||||
Engine::pianoRoll()->restoreState( node.toElement() );
|
||||
gui->pianoRoll()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::automationEditor()->nodeName() )
|
||||
else if( node.nodeName() == gui->automationEditor()->m_editor->nodeName() )
|
||||
{
|
||||
Engine::automationEditor()->restoreState( node.toElement() );
|
||||
gui->automationEditor()->m_editor->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::getProjectNotes()->nodeName() )
|
||||
else if( node.nodeName() == gui->getProjectNotes()->nodeName() )
|
||||
{
|
||||
Engine::getProjectNotes()->SerializingObject::restoreState( node.toElement() );
|
||||
gui->getProjectNotes()->SerializingObject::restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == m_playPos[Mode_PlaySong].m_timeLine->nodeName() )
|
||||
{
|
||||
@@ -1043,17 +1053,25 @@ void Song::loadProject( const QString & fileName )
|
||||
|
||||
emit projectLoaded();
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if ( hasErrors())
|
||||
{
|
||||
Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
|
||||
if ( Engine::hasGUI() )
|
||||
{
|
||||
QMessageBox::warning( NULL, "LMMS Error report", *errorSummary(),
|
||||
QMessageBox::Ok );
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream(stderr) << *Engine::getSong()->errorSummary() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
m_loadingProject = false;
|
||||
m_modified = false;
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if( gui && gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,10 +1094,10 @@ bool Song::saveProjectFile( const QString & filename )
|
||||
Engine::fxMixer()->saveState( dataFile, dataFile.content() );
|
||||
if( Engine::hasGUI() )
|
||||
{
|
||||
Engine::getControllerRackView()->saveState( dataFile, dataFile.content() );
|
||||
Engine::pianoRoll()->saveState( dataFile, dataFile.content() );
|
||||
Engine::automationEditor()->saveState( dataFile, dataFile.content() );
|
||||
Engine::getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() );
|
||||
gui->getControllerRackView()->saveState( dataFile, dataFile.content() );
|
||||
gui->pianoRoll()->saveState( dataFile, dataFile.content() );
|
||||
gui->automationEditor()->m_editor->saveState( dataFile, dataFile.content() );
|
||||
gui->getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() );
|
||||
m_playPos[Mode_PlaySong].m_timeLine->saveState( dataFile, dataFile.content() );
|
||||
}
|
||||
|
||||
@@ -1104,7 +1122,7 @@ bool Song::guiSaveProject()
|
||||
2000 );
|
||||
ConfigManager::inst()->addRecentlyOpenedProject( m_fileName );
|
||||
m_modified = false;
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
else if( Engine::hasGUI() )
|
||||
{
|
||||
@@ -1207,7 +1225,7 @@ void Song::exportProject( bool multiExport )
|
||||
{
|
||||
if( isEmpty() )
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "Empty project" ),
|
||||
tr( "This project is empty so exporting makes "
|
||||
"no sense. Please put some items into "
|
||||
@@ -1215,7 +1233,11 @@ void Song::exportProject( bool multiExport )
|
||||
return;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
FileDialog efd( Engine::mainWindow() );
|
||||
=======
|
||||
FileDialog efd( gui->mainWindow() );
|
||||
>>>>>>> coding
|
||||
if ( multiExport )
|
||||
{
|
||||
efd.setFileMode( FileDialog::Directory);
|
||||
@@ -1275,7 +1297,11 @@ void Song::exportProject( bool multiExport )
|
||||
}
|
||||
|
||||
const QString exportFileName = efd.selectedFiles()[0] + suffix;
|
||||
<<<<<<< HEAD
|
||||
ExportProjectDialog epd( exportFileName, Engine::mainWindow(), multiExport );
|
||||
=======
|
||||
ExportProjectDialog epd( exportFileName, gui->mainWindow(), multiExport );
|
||||
>>>>>>> coding
|
||||
epd.exec();
|
||||
}
|
||||
}
|
||||
@@ -1296,10 +1322,10 @@ void Song::setModified()
|
||||
if( !m_loadingProject )
|
||||
{
|
||||
m_modified = true;
|
||||
if( Engine::mainWindow() &&
|
||||
QThread::currentThread() == Engine::mainWindow()->thread() )
|
||||
if( Engine::hasGUI() && gui->mainWindow() &&
|
||||
QThread::currentThread() == gui->mainWindow()->thread() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1336,3 +1362,46 @@ void Song::removeController( Controller * controller )
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
void Song::clearErrors()
|
||||
{
|
||||
m_errors->clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Song::collectError( const QString error )
|
||||
{
|
||||
m_errors->append( error );
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Song::hasErrors()
|
||||
{
|
||||
return ( m_errors->length() > 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString* Song::errorSummary()
|
||||
{
|
||||
QString* errors = new QString();
|
||||
|
||||
for ( int i = 0 ; i < m_errors->length() ; i++ )
|
||||
{
|
||||
errors->append( m_errors->value( i ) + "\n" );
|
||||
}
|
||||
|
||||
errors->prepend( "\n\n" );
|
||||
errors->prepend( tr( "The following errors occured while loading: " ) );
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> coding
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
#include "Clipboard.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -248,7 +250,6 @@ TrackContentObjectView::TrackContentObjectView( TrackContentObject * tco,
|
||||
m_tco( tco ),
|
||||
m_trackView( tv ),
|
||||
m_action( NoAction ),
|
||||
m_autoResize( false ),
|
||||
m_initialMousePos( QPoint( 0, 0 ) ),
|
||||
m_initialMouseGlobalPos( QPoint( 0, 0 ) ),
|
||||
m_hint( NULL ),
|
||||
@@ -656,7 +657,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
|
||||
"a copy." ),
|
||||
embed::getIconPixmap( "hint" ), 0 );
|
||||
}
|
||||
else if( m_autoResize == false )
|
||||
else if( !m_tco->getAutoResize() )
|
||||
{
|
||||
m_action = Resize;
|
||||
m_oldTime = m_tco->length();
|
||||
@@ -846,7 +847,11 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me )
|
||||
}
|
||||
else
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if( me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() )
|
||||
=======
|
||||
if( me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() && !m_tco->getAutoResize() )
|
||||
>>>>>>> coding
|
||||
{
|
||||
if( QApplication::overrideCursor() != NULL &&
|
||||
QApplication::overrideCursor()->shape() !=
|
||||
@@ -957,6 +962,7 @@ float TrackContentObjectView::pixelsPerTact()
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
/*! \brief Set whether this trackContentObjectView can resize.
|
||||
*
|
||||
* \param e The boolean state of whether this track content object view
|
||||
@@ -970,6 +976,8 @@ void TrackContentObjectView::setAutoResizeEnabled( bool e )
|
||||
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> coding
|
||||
/*! \brief Detect whether the mouse moved more than n pixels on screen.
|
||||
*
|
||||
* \param _me The QMouseEvent.
|
||||
@@ -1136,7 +1144,7 @@ void TrackContentWidget::update()
|
||||
*/
|
||||
void TrackContentWidget::changePosition( const MidiTime & newPos )
|
||||
{
|
||||
if( m_trackView->trackContainerView() == Engine::getBBEditor() )
|
||||
if( m_trackView->trackContainerView() == gui->getBBEditor()->trackContainerView() )
|
||||
{
|
||||
const int curBB = Engine::getBBTrackContainer()->currentBB();
|
||||
setUpdatesEnabled( false );
|
||||
@@ -1402,6 +1410,11 @@ bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * de )
|
||||
{
|
||||
tco->selectViewOnCreate( true );
|
||||
}
|
||||
//check tco name, if the same as source track name dont copy
|
||||
if( tco->name() == tracks[trackIndex]->name() )
|
||||
{
|
||||
tco->setName( "" );
|
||||
}
|
||||
}
|
||||
|
||||
AutomationPattern::resolveAllIDs();
|
||||
@@ -1467,7 +1480,7 @@ void TrackContentWidget::paintEvent( QPaintEvent * pe )
|
||||
int ppt = static_cast<int>( tcv->pixelsPerTact() );
|
||||
QPainter p( this );
|
||||
// Don't draw background on BB-Editor
|
||||
if( m_trackView->trackContainerView() != Engine::getBBEditor() )
|
||||
if( m_trackView->trackContainerView() != gui->getBBEditor()->trackContainerView() )
|
||||
{
|
||||
p.drawTiledPixmap( rect(), m_background, QPoint(
|
||||
tcv->currentPosition().getTact() * ppt, 0 ) );
|
||||
@@ -1712,6 +1725,29 @@ void TrackOperationsWidget::clearTrack()
|
||||
|
||||
|
||||
|
||||
/*! \brief Create and assign a new FX Channel for this track */
|
||||
void TrackOperationsWidget::createFxLine()
|
||||
{
|
||||
int channelIndex = gui->fxMixerView()->addNewChannel();
|
||||
|
||||
Engine::fxMixer()->effectChannel( channelIndex )->m_name = m_trackView->getTrack()->name();
|
||||
|
||||
assignFxLine(channelIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! \brief Assign a specific FX Channel for this track */
|
||||
void TrackOperationsWidget::assignFxLine(int channelIndex)
|
||||
{
|
||||
Track * track = m_trackView->getTrack();
|
||||
dynamic_cast<InstrumentTrack *>( track )->effectChannelModel()->setValue( channelIndex );
|
||||
|
||||
gui->fxMixerView()->setCurrentFxLine( channelIndex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! \brief Remove this track from the track list
|
||||
*
|
||||
*/
|
||||
@@ -1746,12 +1782,42 @@ void TrackOperationsWidget::updateMenu()
|
||||
{
|
||||
toMenu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) );
|
||||
}
|
||||
|
||||
if( dynamic_cast<InstrumentTrackView *>( m_trackView ) )
|
||||
if( InstrumentTrackView * trackView = dynamic_cast<InstrumentTrackView *>( m_trackView ) )
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
toMenu->addSeparator();
|
||||
toMenu->addMenu( dynamic_cast<InstrumentTrackView *>(
|
||||
m_trackView )->midiMenu() );
|
||||
=======
|
||||
int channelIndex = trackView->model()->effectChannelModel()->value();
|
||||
|
||||
FxChannel * fxChannel = Engine::fxMixer()->effectChannel( channelIndex );
|
||||
|
||||
QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), toMenu );
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(this);
|
||||
|
||||
fxMenu->addAction("Assign to new FX Channel" , this, SLOT( createFxLine() ) );
|
||||
fxMenu->addSeparator();
|
||||
|
||||
|
||||
for (int i = 0; i < Engine::fxMixer()->fxChannels().size(); ++i)
|
||||
{
|
||||
FxChannel * currentChannel = Engine::fxMixer()->fxChannels()[i];
|
||||
|
||||
if ( currentChannel != fxChannel )
|
||||
{
|
||||
QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name );
|
||||
QAction * action = fxMenu->addAction( label, fxMenuSignalMapper, SLOT( map() ) );
|
||||
fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex);
|
||||
}
|
||||
}
|
||||
|
||||
toMenu->addMenu(fxMenu);
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
|
||||
toMenu->addSeparator();
|
||||
toMenu->addMenu( trackView->midiMenu() );
|
||||
>>>>>>> coding
|
||||
}
|
||||
if( dynamic_cast<AutomationTrackView *>( m_trackView ) )
|
||||
{
|
||||
@@ -1767,7 +1833,7 @@ void TrackOperationsWidget::recordingOn()
|
||||
if( atv )
|
||||
{
|
||||
const Track::tcoVector & tcov = atv->getTrack()->getTCOs();
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); ++it )
|
||||
{
|
||||
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
|
||||
if( ap ) { ap->setRecording( true ); }
|
||||
@@ -1783,7 +1849,7 @@ void TrackOperationsWidget::recordingOff()
|
||||
if( atv )
|
||||
{
|
||||
const Track::tcoVector & tcov = atv->getTrack()->getTCOs();
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); ++it )
|
||||
{
|
||||
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
|
||||
if( ap ) { ap->setRecording( false ); }
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "TrackContainer.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ void TrackContainer::loadSettings( const QDomElement & _this )
|
||||
pd = new QProgressDialog( tr( "Loading project..." ),
|
||||
tr( "Cancel" ), 0,
|
||||
_this.childNodes().count(),
|
||||
Engine::mainWindow() );
|
||||
gui->mainWindow() );
|
||||
pd->setWindowModality( Qt::ApplicationModal );
|
||||
pd->setWindowTitle( tr( "Please wait..." ) );
|
||||
pd->show();
|
||||
|
||||
@@ -237,9 +237,9 @@ int AudioDevice::convertToS16( const surroundSampleFrame * _ab,
|
||||
|
||||
void AudioDevice::clearS16Buffer( int_sample_t * _outbuf, const fpp_t _frames )
|
||||
{
|
||||
#ifdef LMMS_DEBUG
|
||||
|
||||
assert( _outbuf != NULL );
|
||||
#endif
|
||||
|
||||
memset( _outbuf, 0, _frames * channels() * BYTES_PER_INT_SAMPLE );
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ bool AudioFileOgg::startEncoding()
|
||||
printf( "Mode initialization failed: invalid parameters for "
|
||||
"bitrate\n" );
|
||||
vorbis_info_clear( &m_vi );
|
||||
delete[] user_comments;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ConfigManager.h"
|
||||
@@ -106,7 +106,7 @@ void AudioJack::restartAfterZombified()
|
||||
{
|
||||
m_active = false;
|
||||
startProcessing();
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "JACK client restarted" ),
|
||||
tr( "LMMS was kicked by JACK for some reason. "
|
||||
"Therefore the JACK backend of LMMS has been "
|
||||
@@ -115,7 +115,7 @@ void AudioJack::restartAfterZombified()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "JACK server down" ),
|
||||
tr( "The JACK server seems to have been shutdown "
|
||||
"and starting a new instance failed. "
|
||||
|
||||
@@ -76,9 +76,9 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf )
|
||||
// make sure buffer is cleaned up properly at the end...
|
||||
sampleFrame * data_ptr = data;
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
|
||||
assert( data != NULL );
|
||||
#endif
|
||||
|
||||
// now copy all buffers into big buffer
|
||||
for( BufferList::ConstIterator it = m_buffers.begin();
|
||||
it != m_buffers.end(); ++it )
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
#include <QPainter>
|
||||
#include <QSplashScreen>
|
||||
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_SCHED_H
|
||||
#include <sched.h>
|
||||
#endif
|
||||
@@ -69,6 +73,7 @@
|
||||
#include "NotePlayHandle.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LmmsStyle.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -102,7 +107,7 @@ int main( int argc, char * * argv )
|
||||
// initialize memory managers
|
||||
MemoryManager::init();
|
||||
NotePlayHandleManager::init();
|
||||
|
||||
|
||||
// intialize RNG
|
||||
srand( getpid() + time( 0 ) );
|
||||
|
||||
@@ -383,7 +388,14 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
|
||||
|
||||
QString pos = QLocale::system().name().left( 2 );
|
||||
ConfigManager::inst()->loadConfigFile();
|
||||
|
||||
// set language
|
||||
QString pos = ConfigManager::inst()->value( "app", "language" );
|
||||
if( pos.isEmpty() )
|
||||
{
|
||||
pos = QLocale::system().name().left( 2 );
|
||||
}
|
||||
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
#undef QT_TRANSLATIONS_DIR
|
||||
@@ -414,32 +426,16 @@ int main( int argc, char * * argv )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ConfigManager::inst()->loadConfigFile();
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
if( !SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS ) )
|
||||
{
|
||||
printf( "Notice: could not set high priority.\n" );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( render_out.isEmpty() )
|
||||
{
|
||||
// init style and palette
|
||||
LmmsStyle * lmmsstyle = new LmmsStyle();
|
||||
QApplication::setStyle( lmmsstyle );
|
||||
|
||||
LmmsPalette * lmmspal = new LmmsPalette( NULL, lmmsstyle );
|
||||
QPalette lpal = lmmspal->palette();
|
||||
|
||||
QApplication::setPalette( lpal );
|
||||
LmmsStyle::s_palette = &lpal;
|
||||
|
||||
|
||||
// show splash screen
|
||||
QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
|
||||
splashScreen.show();
|
||||
splashScreen.showMessage( MainWindow::tr( "Version %1" ).arg( LMMS_VERSION ),
|
||||
Qt::AlignRight | Qt::AlignBottom, Qt::white );
|
||||
qApp->processEvents();
|
||||
|
||||
// init central engine which handles all components of LMMS
|
||||
Engine::init();
|
||||
|
||||
splashScreen.hide();
|
||||
new GuiApplication();
|
||||
|
||||
// re-intialize RNG - shared libraries might have srand() or
|
||||
// srandom() calls in their init procedure
|
||||
@@ -449,7 +445,7 @@ int main( int argc, char * * argv )
|
||||
QString recoveryFile = ConfigManager::inst()->recoveryFile();
|
||||
|
||||
if( QFileInfo(recoveryFile).exists() &&
|
||||
QMessageBox::question( Engine::mainWindow(), MainWindow::tr( "Project recovery" ),
|
||||
QMessageBox::question( gui->mainWindow(), MainWindow::tr( "Project recovery" ),
|
||||
MainWindow::tr( "It looks like the last session did not end properly. "
|
||||
"Do you want to recover the project of this session?" ),
|
||||
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
|
||||
@@ -460,10 +456,10 @@ int main( int argc, char * * argv )
|
||||
// we try to load given file
|
||||
if( !file_to_load.isEmpty() )
|
||||
{
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
if( file_to_load == recoveryFile )
|
||||
{
|
||||
@@ -482,10 +478,10 @@ int main( int argc, char * * argv )
|
||||
return 0;
|
||||
}
|
||||
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -494,17 +490,18 @@ int main( int argc, char * * argv )
|
||||
|
||||
// [Settel] workaround: showMaximized() doesn't work with
|
||||
// FVWM2 unless the window is already visible -> show() first
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// we're going to render our song
|
||||
Engine::init( false );
|
||||
Engine::init();
|
||||
|
||||
printf( "loading project...\n" );
|
||||
Engine::getSong()->loadProject( file_to_load );
|
||||
@@ -536,9 +533,9 @@ int main( int argc, char * * argv )
|
||||
|
||||
const int ret = app->exec();
|
||||
delete app;
|
||||
|
||||
|
||||
// cleanup memory managers
|
||||
MemoryManager::cleanup();
|
||||
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AboutDialog.cpp - implementation of about-dialog
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -26,14 +26,12 @@
|
||||
#include "lmmsversion.h"
|
||||
#include "AboutDialog.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "MainWindow.h"
|
||||
#include "versioninfo.h"
|
||||
|
||||
|
||||
|
||||
AboutDialog::AboutDialog() :
|
||||
QDialog( Engine::mainWindow() ),
|
||||
AboutDialog::AboutDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
Ui::AboutDialog()
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
55
src/gui/ActionGroup.cpp
Normal file
55
src/gui/ActionGroup.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Editor.h - declaration of Editor class
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ActionGroup.h"
|
||||
|
||||
ActionGroup::ActionGroup(QObject* parent) : QActionGroup(parent)
|
||||
{
|
||||
connect(this, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered_(QAction*)));
|
||||
}
|
||||
|
||||
QAction* ActionGroup::addAction(QAction* a)
|
||||
{
|
||||
a->setCheckable(true);
|
||||
|
||||
return QActionGroup::addAction(a);
|
||||
}
|
||||
|
||||
QAction* ActionGroup::addAction(const QString& text)
|
||||
{
|
||||
return addAction(new QAction(text, this));
|
||||
}
|
||||
|
||||
QAction* ActionGroup::addAction(const QIcon& icon, const QString& text)
|
||||
{
|
||||
return addAction(new QAction(icon, text, this));
|
||||
}
|
||||
|
||||
void ActionGroup::actionTriggered_(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action != 0);
|
||||
Q_ASSERT(actions().contains(action));
|
||||
|
||||
emit triggered(actions().indexOf(action));
|
||||
}
|
||||
@@ -30,9 +30,12 @@
|
||||
#include "ControllerConnectionDialog.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "StringPairDrag.h"
|
||||
|
||||
#include "AutomationEditor.h"
|
||||
|
||||
|
||||
|
||||
AutomatableModelView::AutomatableModelView( ::Model* model, QWidget* _this ) :
|
||||
@@ -177,7 +180,7 @@ void AutomatableModelViewSlots::execConnectionDialog()
|
||||
AutomatableModel* m = m_amv->modelUntyped();
|
||||
|
||||
m->displayName();
|
||||
ControllerConnectionDialog d( (QWidget*) Engine::mainWindow(), m );
|
||||
ControllerConnectionDialog d( gui->mainWindow(), m );
|
||||
|
||||
if( d.exec() == 1 )
|
||||
{
|
||||
@@ -224,7 +227,9 @@ void AutomatableModelViewSlots::removeConnection()
|
||||
|
||||
void AutomatableModelViewSlots::editSongGlobalAutomation()
|
||||
{
|
||||
AutomationPattern::globalAutomationPattern( m_amv->modelUntyped() )->openInAutomationEditor();
|
||||
gui->automationEditor()->open(
|
||||
AutomationPattern::globalAutomationPattern(m_amv->modelUntyped())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "AutomationEditor.h"
|
||||
#include "AutomationPattern.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "RenameDialog.h"
|
||||
@@ -49,12 +49,11 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern,
|
||||
{
|
||||
connect( m_pat, SIGNAL( dataChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( Engine::automationEditor(), SIGNAL( currentPatternChanged() ),
|
||||
connect( gui->automationEditor(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
setAutoResizeEnabled( false );
|
||||
|
||||
ToolTip::add( this, tr( "double-click to open this pattern in "
|
||||
"automation editor" ) );
|
||||
@@ -74,6 +73,14 @@ AutomationPatternView::~AutomationPatternView()
|
||||
|
||||
|
||||
|
||||
void AutomationPatternView::openInAutomationEditor()
|
||||
{
|
||||
if(gui) gui->automationEditor()->open(m_pat);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomationPatternView::update()
|
||||
{
|
||||
@@ -123,9 +130,9 @@ void AutomationPatternView::disconnectObject( QAction * _a )
|
||||
update();
|
||||
|
||||
//If automation editor is opened, update its display after disconnection
|
||||
if( Engine::automationEditor() )
|
||||
if( gui->automationEditor() )
|
||||
{
|
||||
Engine::automationEditor()->updateAfterPatternChange();
|
||||
gui->automationEditor()->m_editor->updateAfterPatternChange();
|
||||
}
|
||||
|
||||
//if there is no more connection connected to the AutomationPattern
|
||||
@@ -171,8 +178,7 @@ void AutomationPatternView::constructContextMenu( QMenu * _cm )
|
||||
QAction * a = new QAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open in Automation editor" ), _cm );
|
||||
_cm->insertAction( _cm->actions()[0], a );
|
||||
connect( a, SIGNAL( triggered( bool ) ),
|
||||
m_pat, SLOT( openInAutomationEditor() ) );
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(openInAutomationEditor()));
|
||||
_cm->insertSeparator( _cm->actions()[1] );
|
||||
|
||||
_cm->addSeparator();
|
||||
@@ -223,14 +229,14 @@ void AutomationPatternView::constructContextMenu( QMenu * _cm )
|
||||
|
||||
|
||||
|
||||
void AutomationPatternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
void AutomationPatternView::mouseDoubleClickEvent( QMouseEvent * me )
|
||||
{
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
if(me->button() != Qt::LeftButton)
|
||||
{
|
||||
_me->ignore();
|
||||
me->ignore();
|
||||
return;
|
||||
}
|
||||
m_pat->openInAutomationEditor();
|
||||
openInAutomationEditor();
|
||||
}
|
||||
|
||||
|
||||
@@ -259,17 +265,22 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
QColor c;
|
||||
|
||||
if( !( m_pat->getTrack()->isMuted() || m_pat->isMuted() ) )
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: styleColor;
|
||||
c = styleColor;
|
||||
else
|
||||
c = QColor( 80,80,80 );
|
||||
c = QColor( 80, 80, 80 );
|
||||
|
||||
if( isSelected() == true )
|
||||
{
|
||||
c.setRgb( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
|
||||
}
|
||||
|
||||
lingrad.setColorAt( 1, c.darker( 300 ) );
|
||||
lingrad.setColorAt( 0, c );
|
||||
|
||||
p.setBrush( lingrad );
|
||||
if( Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
@@ -352,7 +363,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
// outer edge
|
||||
p.setBrush( QBrush() );
|
||||
if( Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
@@ -413,10 +424,10 @@ void AutomationPatternView::dropEvent( QDropEvent * _de )
|
||||
}
|
||||
update();
|
||||
|
||||
if( Engine::automationEditor() &&
|
||||
Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor() &&
|
||||
gui->automationEditor()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( m_pat );
|
||||
gui->automationEditor()->setCurrentPattern( m_pat );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
94
src/gui/CMakeLists.txt
Normal file
94
src/gui/CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
SET(LMMS_SRCS
|
||||
${LMMS_SRCS}
|
||||
gui/AboutDialog.cpp
|
||||
gui/ActionGroup.cpp
|
||||
gui/AutomatableModelView.cpp
|
||||
gui/AutomationPatternView.cpp
|
||||
gui/ControllerConnectionDialog.cpp
|
||||
gui/ControllerDialog.cpp
|
||||
gui/EffectControlDialog.cpp
|
||||
gui/EffectSelectDialog.cpp
|
||||
gui/embed.cpp
|
||||
gui/ExportProjectDialog.cpp
|
||||
gui/FileBrowser.cpp
|
||||
gui/FxMixerView.cpp
|
||||
gui/GuiApplication.cpp
|
||||
gui/InstrumentView.cpp
|
||||
gui/LfoControllerDialog.cpp
|
||||
gui/LmmsPalette.cpp
|
||||
gui/LmmsStyle.cpp
|
||||
gui/MainWindow.cpp
|
||||
gui/ModelView.cpp
|
||||
gui/PeakControllerDialog.cpp
|
||||
gui/PianoView.cpp
|
||||
gui/PluginBrowser.cpp
|
||||
gui/SetupDialog.cpp
|
||||
gui/StringPairDrag.cpp
|
||||
gui/TimeLineWidget.cpp
|
||||
gui/ToolPluginView.cpp
|
||||
gui/TrackContainerView.cpp
|
||||
|
||||
gui/dialogs/FileDialog.cpp
|
||||
gui/dialogs/VersionedSaveDialog.cpp
|
||||
|
||||
gui/editors/AutomationEditor.cpp
|
||||
gui/editors/BBEditor.cpp
|
||||
gui/editors/Editor.cpp
|
||||
gui/editors/PianoRoll.cpp
|
||||
gui/editors/SongEditor.cpp
|
||||
|
||||
gui/widgets/AutomatableButton.cpp
|
||||
gui/widgets/AutomatableSlider.cpp
|
||||
gui/widgets/CaptionMenu.cpp
|
||||
gui/widgets/ComboBox.cpp
|
||||
gui/widgets/ControllerRackView.cpp
|
||||
gui/widgets/ControllerView.cpp
|
||||
gui/widgets/CPULoadWidget.cpp
|
||||
gui/widgets/EffectRackView.cpp
|
||||
gui/widgets/EffectView.cpp
|
||||
gui/widgets/EnvelopeAndLfoView.cpp
|
||||
gui/widgets/FadeButton.cpp
|
||||
gui/widgets/Fader.cpp
|
||||
gui/widgets/FxLine.cpp
|
||||
gui/widgets/Graph.cpp
|
||||
gui/widgets/GroupBox.cpp
|
||||
gui/widgets/InstrumentFunctionViews.cpp
|
||||
gui/widgets/InstrumentMidiIOView.cpp
|
||||
gui/widgets/InstrumentSoundShapingView.cpp
|
||||
gui/widgets/Knob.cpp
|
||||
gui/widgets/LadspaControlView.cpp
|
||||
gui/widgets/LcdSpinBox.cpp
|
||||
gui/widgets/LcdWidget.cpp
|
||||
gui/widgets/LedCheckbox.cpp
|
||||
gui/widgets/MeterDialog.cpp
|
||||
gui/widgets/MidiPortMenu.cpp
|
||||
gui/widgets/NStateButton.cpp
|
||||
gui/widgets/PixmapButton.cpp
|
||||
gui/widgets/ProjectNotes.cpp
|
||||
gui/widgets/RenameDialog.cpp
|
||||
gui/widgets/Rubberband.cpp
|
||||
gui/widgets/SendButtonIndicator.cpp
|
||||
gui/widgets/SideBar.cpp
|
||||
gui/widgets/SideBarWidget.cpp
|
||||
gui/widgets/TabBar.cpp
|
||||
gui/widgets/TabWidget.cpp
|
||||
gui/widgets/TempoSyncKnob.cpp
|
||||
gui/widgets/TextFloat.cpp
|
||||
gui/widgets/TimeDisplayWidget.cpp
|
||||
gui/widgets/ToolButton.cpp
|
||||
gui/widgets/ToolTip.cpp
|
||||
gui/widgets/TrackLabelButton.cpp
|
||||
gui/widgets/VisualizationWidget.cpp
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
set(LMMS_UIS
|
||||
${LMMS_UIS}
|
||||
gui/dialogs/about_dialog.ui
|
||||
gui/dialogs/export_project.ui
|
||||
|
||||
gui/Forms/EffectSelectDialog.ui
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "ExportProjectDialog.h"
|
||||
#include "Song.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "BBTrack.h"
|
||||
@@ -282,7 +282,7 @@ void ExportProjectDialog::render( ProjectRenderer* renderer )
|
||||
connect( renderer, SIGNAL( progressChanged( int ) ), progressBar, SLOT( setValue( int ) ) );
|
||||
connect( renderer, SIGNAL( progressChanged( int ) ), this, SLOT( updateTitleBar( int ) )) ;
|
||||
connect( renderer, SIGNAL( finished() ), this, SLOT( accept() ) );
|
||||
connect( renderer, SIGNAL( finished() ), Engine::mainWindow(), SLOT( resetWindowTitle() ) );
|
||||
connect( renderer, SIGNAL( finished() ), gui->mainWindow(), SLOT( resetWindowTitle() ) );
|
||||
|
||||
renderer->startProcessing();
|
||||
}
|
||||
@@ -341,6 +341,6 @@ void ExportProjectDialog::startBtnClicked()
|
||||
|
||||
void ExportProjectDialog::updateTitleBar( int _prog )
|
||||
{
|
||||
Engine::mainWindow()->setWindowTitle(
|
||||
gui->mainWindow()->setWindowTitle(
|
||||
tr( "Rendering: %1%" ).arg( _prog ) );
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "debug.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "Instrument.h"
|
||||
@@ -62,11 +63,12 @@ enum TreeWidgetItemTypes
|
||||
|
||||
FileBrowser::FileBrowser(const QString & directories, const QString & filter,
|
||||
const QString & title, const QPixmap & pm,
|
||||
QWidget * parent, bool dirs_as_items ) :
|
||||
QWidget * parent, bool dirs_as_items, bool recurse ) :
|
||||
SideBarWidget( title, pm, parent ),
|
||||
m_directories( directories ),
|
||||
m_filter( filter ),
|
||||
m_dirsAsItems( dirs_as_items )
|
||||
m_dirsAsItems( dirs_as_items ),
|
||||
m_recurse( recurse )
|
||||
{
|
||||
setWindowTitle( tr( "Browser" ) );
|
||||
m_l = new FileBrowserTreeWidget( contentParent() );
|
||||
@@ -233,6 +235,19 @@ void FileBrowser::reloadTree( void )
|
||||
{
|
||||
addItems( *it );
|
||||
}
|
||||
for(int i = 0; i < m_l->topLevelItemCount(); ++i)
|
||||
{
|
||||
if ( m_recurse )
|
||||
{
|
||||
m_l->topLevelItem( i )->setExpanded( true);
|
||||
}
|
||||
Directory *d = dynamic_cast<Directory *> ( m_l->topLevelItem( i ) );
|
||||
if( d )
|
||||
{
|
||||
d->update();
|
||||
d->setExpanded( false );
|
||||
}
|
||||
}
|
||||
m_filterEdit->setText( text );
|
||||
filterItems( text );
|
||||
}
|
||||
@@ -244,8 +259,7 @@ void FileBrowser::addItems(const QString & path )
|
||||
{
|
||||
if( m_dirsAsItems )
|
||||
{
|
||||
m_l->addTopLevelItem( new Directory( path,
|
||||
QString::null, m_filter ) );
|
||||
m_l->addTopLevelItem( new Directory( path, QString::null, m_filter ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -264,23 +278,27 @@ void FileBrowser::addItems(const QString & path )
|
||||
m_l->topLevelItem( i ) );
|
||||
if( d == NULL || cur_file < d->text( 0 ) )
|
||||
{
|
||||
m_l->insertTopLevelItem( i,
|
||||
new Directory( cur_file, path,
|
||||
m_filter ) );
|
||||
Directory *dd = new Directory( cur_file, path,
|
||||
m_filter );
|
||||
m_l->insertTopLevelItem( i,dd );
|
||||
dd->update();
|
||||
orphan = false;
|
||||
break;
|
||||
}
|
||||
else if( cur_file == d->text( 0 ) )
|
||||
{
|
||||
d->addDirectory( path );
|
||||
d->update();
|
||||
orphan = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( orphan )
|
||||
{
|
||||
m_l->addTopLevelItem( new Directory( cur_file,
|
||||
path, m_filter ) );
|
||||
Directory *d = new Directory( cur_file,
|
||||
path, m_filter );
|
||||
d->update();
|
||||
m_l->addTopLevelItem( d );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -347,6 +365,7 @@ FileBrowserTreeWidget::FileBrowserTreeWidget(QWidget * parent ) :
|
||||
SLOT( updateDirectory( QTreeWidgetItem * ) ) );
|
||||
connect( this, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
|
||||
SLOT( updateDirectory( QTreeWidgetItem * ) ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -549,7 +568,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it )
|
||||
switch( f->handling() )
|
||||
{
|
||||
case FileItem::LoadAsProject:
|
||||
if( Engine::mainWindow()->mayChangeProject() )
|
||||
if( gui->mainWindow()->mayChangeProject() )
|
||||
{
|
||||
Engine::getSong()->loadProject( f->fullName() );
|
||||
}
|
||||
@@ -580,7 +599,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it )
|
||||
|
||||
case FileItem::ImportAsProject:
|
||||
if( f->type() == FileItem::FlpFile &&
|
||||
!Engine::mainWindow()->mayChangeProject() )
|
||||
!gui->mainWindow()->mayChangeProject() )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -663,7 +682,7 @@ void FileBrowserTreeWidget::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
// get all windows opened in the workspace
|
||||
QList<QMdiSubWindow*> pl =
|
||||
Engine::mainWindow()->workspace()->
|
||||
gui->mainWindow()->workspace()->
|
||||
subWindowList( QMdiArea::StackingOrder );
|
||||
QListIterator<QMdiSubWindow *> w( pl );
|
||||
w.toBack();
|
||||
@@ -708,7 +727,8 @@ Directory::Directory(const QString & filename, const QString & path,
|
||||
const QString & filter ) :
|
||||
QTreeWidgetItem( QStringList( filename ), TypeDirectoryItem ),
|
||||
m_directories( path ),
|
||||
m_filter( filter )
|
||||
m_filter( filter ),
|
||||
m_dirCount( 0 )
|
||||
{
|
||||
initPixmaps();
|
||||
|
||||
@@ -762,6 +782,7 @@ void Directory::update( void )
|
||||
setIcon( 0, *s_folderOpenedPixmap );
|
||||
if( !childCount() )
|
||||
{
|
||||
m_dirCount = 0;
|
||||
for( QStringList::iterator it = m_directories.begin();
|
||||
it != m_directories.end(); ++it )
|
||||
{
|
||||
@@ -776,7 +797,7 @@ void Directory::update( void )
|
||||
"--- Factory files ---" ) );
|
||||
sep->setIcon( 0, embed::getIconPixmap(
|
||||
"factory_files" ) );
|
||||
insertChild( top_index, sep );
|
||||
insertChild( m_dirCount + top_index - 1, sep );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -814,6 +835,9 @@ bool Directory::addItems(const QString & path )
|
||||
insertChild( i, new Directory( cur_file,
|
||||
path, m_filter ) );
|
||||
orphan = false;
|
||||
m_dirCount++;
|
||||
//recurse for each dir
|
||||
addItems( path + cur_file + QDir::separator() );
|
||||
break;
|
||||
}
|
||||
else if( cur_file == d->text( 0 ) )
|
||||
@@ -827,6 +851,9 @@ bool Directory::addItems(const QString & path )
|
||||
{
|
||||
addChild( new Directory( cur_file, path,
|
||||
m_filter ) );
|
||||
m_dirCount++;
|
||||
//recurse for each dir
|
||||
addItems( path + cur_file + QDir::separator() );
|
||||
}
|
||||
|
||||
added_something = true;
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "Knob.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentTrack.h"
|
||||
@@ -141,13 +142,13 @@ FxMixerView::FxMixerView() :
|
||||
updateGeometry();
|
||||
|
||||
// timer for updating faders
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( updateFaders() ) );
|
||||
|
||||
|
||||
// add ourself to workspace
|
||||
QMdiSubWindow * subWin =
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
subWin->setWindowFlags( flags );
|
||||
@@ -171,7 +172,7 @@ FxMixerView::~FxMixerView()
|
||||
|
||||
|
||||
|
||||
void FxMixerView::addNewChannel()
|
||||
int FxMixerView::addNewChannel()
|
||||
{
|
||||
// add new fx mixer channel and redraw the form.
|
||||
FxMixer * mix = Engine::fxMixer();
|
||||
@@ -185,6 +186,8 @@ void FxMixerView::addNewChannel()
|
||||
updateFxLine(newChannelIndex);
|
||||
|
||||
updateMaxChannelSelector();
|
||||
|
||||
return newChannelIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
94
src/gui/GuiApplication.cpp
Normal file
94
src/gui/GuiApplication.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* GuiApplication.cpp
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GuiApplication.h"
|
||||
|
||||
#include "lmmsversion.h"
|
||||
|
||||
#include "LmmsStyle.h"
|
||||
#include "LmmsPalette.h"
|
||||
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "ProjectNotes.h"
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSplashScreen>
|
||||
|
||||
GuiApplication* GuiApplication::s_instance = nullptr;
|
||||
|
||||
GuiApplication* GuiApplication::instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
GuiApplication::GuiApplication()
|
||||
{
|
||||
// Init style and palette
|
||||
LmmsStyle* lmmsstyle = new LmmsStyle();
|
||||
QApplication::setStyle(lmmsstyle);
|
||||
|
||||
LmmsPalette* lmmspal = new LmmsPalette(nullptr, lmmsstyle);
|
||||
QPalette* lpal = new QPalette(lmmspal->palette());
|
||||
|
||||
QApplication::setPalette( *lpal );
|
||||
LmmsStyle::s_palette = lpal;
|
||||
|
||||
// Show splash screen
|
||||
QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
|
||||
splashScreen.show();
|
||||
splashScreen.showMessage( MainWindow::tr( "Version %1" ).arg( LMMS_VERSION ),
|
||||
Qt::AlignRight | Qt::AlignBottom, Qt::white );
|
||||
qApp->processEvents();
|
||||
|
||||
// Init central engine which handles all components of LMMS
|
||||
Engine::init();
|
||||
|
||||
s_instance = this;
|
||||
|
||||
m_mainWindow = new MainWindow;
|
||||
|
||||
m_songEditor = new SongEditorWindow(Engine::getSong());
|
||||
m_fxMixerView = new FxMixerView;
|
||||
m_controllerRackView = new ControllerRackView;
|
||||
m_projectNotes = new ProjectNotes;
|
||||
m_bbEditor = new BBEditor(Engine::getBBTrackContainer());
|
||||
m_pianoRoll = new PianoRollWindow();
|
||||
m_automationEditor = new AutomationEditorWindow;
|
||||
|
||||
m_mainWindow->finalize();
|
||||
splashScreen.finish(m_mainWindow);
|
||||
}
|
||||
|
||||
GuiApplication::~GuiApplication()
|
||||
{
|
||||
InstrumentTrackView::cleanupWindowCache();
|
||||
s_instance = nullptr;
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QDomElement>
|
||||
#include <QUrl>
|
||||
@@ -36,7 +37,7 @@
|
||||
#include <QWhatsThis>
|
||||
|
||||
#include "lmmsversion.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "BBEditor.h"
|
||||
#include "SongEditor.h"
|
||||
#include "Song.h"
|
||||
@@ -101,24 +102,24 @@ MainWindow::MainWindow() :
|
||||
"*.mmp *.mmpz *.xml *.mid *.flp",
|
||||
tr( "My Projects" ),
|
||||
embed::getIconPixmap( "project_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
splitter, false, true ) );
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
ConfigManager::inst()->userSamplesDir() + "*" +
|
||||
ConfigManager::inst()->factorySamplesDir(),
|
||||
"*", tr( "My Samples" ),
|
||||
embed::getIconPixmap( "sample_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
splitter, false, true ) );
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
ConfigManager::inst()->userPresetsDir() + "*" +
|
||||
ConfigManager::inst()->factoryPresetsDir(),
|
||||
"*.xpf *.cs.xml *.xiz",
|
||||
tr( "My Presets" ),
|
||||
embed::getIconPixmap( "preset_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
splitter , false, true ) );
|
||||
sideBar->appendTab( new FileBrowser( QDir::homePath(), "*",
|
||||
tr( "My Home" ),
|
||||
embed::getIconPixmap( "home" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter ) );
|
||||
splitter, false, true ) );
|
||||
|
||||
QStringList root_paths;
|
||||
#ifdef LMMS_BUILD_APPLE
|
||||
@@ -189,8 +190,6 @@ MainWindow::MainWindow() :
|
||||
vbox->addWidget( w );
|
||||
setCentralWidget( main_widget );
|
||||
|
||||
m_errors = new QList<QString>();
|
||||
|
||||
m_updateTimer.start( 1000 / 20, this ); // 20 fps
|
||||
|
||||
if( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() )
|
||||
@@ -232,7 +231,7 @@ void MainWindow::finalize()
|
||||
|
||||
// project-popup-menu
|
||||
QMenu * project_menu = new QMenu( this );
|
||||
menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) );
|
||||
menuBar()->addMenu( project_menu )->setText( tr( "&File" ) );
|
||||
project_menu->addAction( embed::getIconPixmap( "project_new" ),
|
||||
tr( "&New" ),
|
||||
this, SLOT( createNewProject() ),
|
||||
@@ -255,15 +254,14 @@ void MainWindow::finalize()
|
||||
tr( "&Save" ),
|
||||
this, SLOT( saveProject() ),
|
||||
Qt::CTRL + Qt::Key_S );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "Save as New &Version" ),
|
||||
this, SLOT( saveProjectAsNewVersion() ),
|
||||
Qt::CTRL + Qt::ALT + Qt::Key_S );
|
||||
project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
|
||||
tr( "Save &As..." ),
|
||||
this, SLOT( saveProjectAs() ),
|
||||
Qt::CTRL + Qt::SHIFT + Qt::Key_S );
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "Save as New &Version" ),
|
||||
this, SLOT( saveProjectAsNewVersion() ),
|
||||
Qt::CTRL + Qt::ALT + Qt::Key_S );
|
||||
project_menu->addSeparator();
|
||||
project_menu->addAction( embed::getIconPixmap( "project_import" ),
|
||||
tr( "Import..." ),
|
||||
@@ -530,6 +528,29 @@ void MainWindow::finalize()
|
||||
SetupDialog sd( SetupDialog::AudioSettings );
|
||||
sd.exec();
|
||||
}
|
||||
|
||||
// Add editor subwindows
|
||||
for (QWidget* widget : std::list<QWidget*>{
|
||||
gui->automationEditor(),
|
||||
gui->getBBEditor(),
|
||||
gui->pianoRoll(),
|
||||
gui->songEditor()
|
||||
})
|
||||
{
|
||||
QMdiSubWindow* window = workspace()->addSubWindow(widget);
|
||||
window->setWindowIcon(widget->windowIcon());
|
||||
window->setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
window->resize(widget->sizeHint());
|
||||
}
|
||||
|
||||
gui->automationEditor()->parentWidget()->hide();
|
||||
gui->getBBEditor()->parentWidget()->move( 610, 5 );
|
||||
gui->getBBEditor()->parentWidget()->show();
|
||||
gui->pianoRoll()->parentWidget()->move(5, 5);
|
||||
gui->pianoRoll()->parentWidget()->hide();
|
||||
gui->songEditor()->parentWidget()->move(5, 5);
|
||||
gui->songEditor()->parentWidget()->show();
|
||||
|
||||
// reset window title every time we change the state of a subwindow to show the correct title
|
||||
foreach( QMdiSubWindow * subWindow, workspace()->subWindowList() )
|
||||
{
|
||||
@@ -855,7 +876,7 @@ void MainWindow::showSettingsDialog()
|
||||
|
||||
void MainWindow::aboutLMMS()
|
||||
{
|
||||
AboutDialog().exec();
|
||||
AboutDialog(this).exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -912,10 +933,10 @@ void MainWindow::refocus()
|
||||
{
|
||||
QList<QWidget*> editors;
|
||||
editors
|
||||
<< Engine::songEditor()->parentWidget()
|
||||
<< Engine::getBBEditor()->parentWidget()
|
||||
<< Engine::pianoRoll()->parentWidget()
|
||||
<< Engine::automationEditor()->parentWidget();
|
||||
<< gui->songEditor()->parentWidget()
|
||||
<< gui->getBBEditor()->parentWidget()
|
||||
<< gui->pianoRoll()->parentWidget()
|
||||
<< gui->automationEditor()->parentWidget();
|
||||
|
||||
bool found = false;
|
||||
QList<QWidget*>::Iterator editor;
|
||||
@@ -937,7 +958,7 @@ void MainWindow::refocus()
|
||||
|
||||
void MainWindow::toggleBBEditorWin( bool forceShow )
|
||||
{
|
||||
toggleWindow( Engine::getBBEditor(), forceShow );
|
||||
toggleWindow( gui->getBBEditor(), forceShow );
|
||||
}
|
||||
|
||||
|
||||
@@ -945,7 +966,7 @@ void MainWindow::toggleBBEditorWin( bool forceShow )
|
||||
|
||||
void MainWindow::toggleSongEditorWin()
|
||||
{
|
||||
toggleWindow( Engine::songEditor() );
|
||||
toggleWindow( gui->songEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -953,7 +974,7 @@ void MainWindow::toggleSongEditorWin()
|
||||
|
||||
void MainWindow::toggleProjectNotesWin()
|
||||
{
|
||||
toggleWindow( Engine::getProjectNotes() );
|
||||
toggleWindow( gui->getProjectNotes() );
|
||||
}
|
||||
|
||||
|
||||
@@ -961,7 +982,7 @@ void MainWindow::toggleProjectNotesWin()
|
||||
|
||||
void MainWindow::togglePianoRollWin()
|
||||
{
|
||||
toggleWindow( Engine::pianoRoll() );
|
||||
toggleWindow( gui->pianoRoll() );
|
||||
}
|
||||
|
||||
|
||||
@@ -969,7 +990,7 @@ void MainWindow::togglePianoRollWin()
|
||||
|
||||
void MainWindow::toggleAutomationEditorWin()
|
||||
{
|
||||
toggleWindow( Engine::automationEditor() );
|
||||
toggleWindow( gui->automationEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -977,7 +998,7 @@ void MainWindow::toggleAutomationEditorWin()
|
||||
|
||||
void MainWindow::toggleFxMixerWin()
|
||||
{
|
||||
toggleWindow( Engine::fxMixerView() );
|
||||
toggleWindow( gui->fxMixerView() );
|
||||
}
|
||||
|
||||
|
||||
@@ -985,7 +1006,7 @@ void MainWindow::toggleFxMixerWin()
|
||||
|
||||
void MainWindow::toggleControllerRack()
|
||||
{
|
||||
toggleWindow( Engine::getControllerRackView() );
|
||||
toggleWindow( gui->getControllerRackView() );
|
||||
}
|
||||
|
||||
|
||||
@@ -993,29 +1014,29 @@ void MainWindow::toggleControllerRack()
|
||||
|
||||
void MainWindow::updatePlayPauseIcons()
|
||||
{
|
||||
Engine::songEditor()->setPauseIcon( false );
|
||||
Engine::automationEditor()->setPauseIcon( false );
|
||||
Engine::getBBEditor()->setPauseIcon( false );
|
||||
Engine::pianoRoll()->setPauseIcon( false );
|
||||
gui->songEditor()->setPauseIcon( false );
|
||||
gui->automationEditor()->setPauseIcon( false );
|
||||
gui->getBBEditor()->setPauseIcon( false );
|
||||
gui->pianoRoll()->setPauseIcon( false );
|
||||
|
||||
if( Engine::getSong()->isPlaying() )
|
||||
{
|
||||
switch( Engine::getSong()->playMode() )
|
||||
{
|
||||
case Song::Mode_PlaySong:
|
||||
Engine::songEditor()->setPauseIcon( true );
|
||||
gui->songEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayAutomationPattern:
|
||||
Engine::automationEditor()->setPauseIcon( true );
|
||||
gui->automationEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayBB:
|
||||
Engine::getBBEditor()->setPauseIcon( true );
|
||||
gui->getBBEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayPattern:
|
||||
Engine::pianoRoll()->setPauseIcon( true );
|
||||
gui->pianoRoll()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1201,43 +1222,3 @@ void MainWindow::autoSave()
|
||||
QTimer::singleShot( 10*1000, this, SLOT( autoSave() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::collectErrors(const QList<QString>* errors )
|
||||
{
|
||||
m_errors->append( *errors );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::collectError( const QString error )
|
||||
{
|
||||
m_errors->append( error );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::clearErrors()
|
||||
{
|
||||
m_errors->clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::showErrors( const QString message )
|
||||
{
|
||||
if ( m_errors->length() != 0 )
|
||||
{ QString* errors = new QString();
|
||||
for ( int i = 0 ; i < m_errors->length() ; i++ )
|
||||
{
|
||||
errors->append( m_errors->value( i ) + "\n" );
|
||||
}
|
||||
errors->prepend( "\n\n" );
|
||||
errors->prepend( message );
|
||||
QMessageBox::warning( NULL,
|
||||
"LMMS Error report",
|
||||
*errors,
|
||||
QMessageBox::Ok );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ PluginDescList::PluginDescList(QWidget *parent) :
|
||||
std::sort(m_pluginDescriptors.begin(), m_pluginDescriptors.end(), pluginBefore);
|
||||
|
||||
|
||||
for(Plugin::DescriptorList::const_iterator it = m_pluginDescriptors.constBegin();
|
||||
it != m_pluginDescriptors.constEnd(); it++)
|
||||
for( Plugin::DescriptorList::const_iterator it = m_pluginDescriptors.constBegin();
|
||||
it != m_pluginDescriptors.constEnd(); ++it )
|
||||
{
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
|
||||
@@ -73,9 +73,9 @@ inline void labelWidget( QWidget * _w, const QString & _txt )
|
||||
f.setBold( true );
|
||||
title->setFont( pointSize<12>( f ) );
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
|
||||
assert( dynamic_cast<QBoxLayout *>( _w->layout() ) != NULL );
|
||||
#endif
|
||||
|
||||
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 5 );
|
||||
dynamic_cast<QBoxLayout *>( _w->layout() )->addWidget( title );
|
||||
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 10 );
|
||||
@@ -94,20 +94,24 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
|
||||
m_displaydBV( ConfigManager::inst()->value( "app",
|
||||
"displaydbv" ).toInt() ),
|
||||
m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ),
|
||||
m_disableBackup( !ConfigManager::inst()->value( "app",
|
||||
"disablebackup" ).toInt() ),
|
||||
m_hqAudioDev( ConfigManager::inst()->value( "mixer",
|
||||
"hqaudio" ).toInt() ),
|
||||
m_workingDir( ConfigManager::inst()->workingDir() ),
|
||||
m_vstDir( ConfigManager::inst()->vstDir() ),
|
||||
m_artworkDir( ConfigManager::inst()->artworkDir() ),
|
||||
m_flDir( ConfigManager::inst()->flDir() ),
|
||||
m_ladDir( ConfigManager::inst()->ladspaDir() ),
|
||||
m_lang( ConfigManager::inst()->value( "app",
|
||||
"language" ) ),
|
||||
m_workingDir( QDir::toNativeSeparators( ConfigManager::inst()->workingDir() ) ),
|
||||
m_vstDir( QDir::toNativeSeparators( ConfigManager::inst()->vstDir() ) ),
|
||||
m_artworkDir( QDir::toNativeSeparators( ConfigManager::inst()->artworkDir() ) ),
|
||||
m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ),
|
||||
m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ),
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
m_defaultSoundfont( ConfigManager::inst()->defaultSoundfont() ),
|
||||
m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ),
|
||||
#endif
|
||||
#ifdef LMMS_HAVE_STK
|
||||
m_stkDir( ConfigManager::inst()->stkDir() ),
|
||||
m_stkDir( QDir::toNativeSeparators( ConfigManager::inst()->stkDir() ) ),
|
||||
#endif
|
||||
m_backgroundArtwork( ConfigManager::inst()->backgroundArtwork() ),
|
||||
m_backgroundArtwork( QDir::toNativeSeparators( ConfigManager::inst()->backgroundArtwork() ) ),
|
||||
m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ),
|
||||
m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ),
|
||||
m_oneInstrumentTrackWindow( ConfigManager::inst()->value( "ui",
|
||||
@@ -300,12 +304,63 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
|
||||
connect( disableAutoquit, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( toggleDisableAutoquit( bool ) ) );
|
||||
|
||||
LedCheckBox * disableBackup = new LedCheckBox(
|
||||
tr( "Create backup file when saving a project" ),
|
||||
misc_tw );
|
||||
labelNumber++;
|
||||
disableBackup->move( XDelta, YDelta*labelNumber );
|
||||
disableBackup->setChecked( m_disableBackup );
|
||||
connect( disableBackup, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( toggleDisableBackup( bool ) ) );
|
||||
|
||||
misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize );
|
||||
|
||||
TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general );
|
||||
lang_tw->setFixedHeight( 48 );
|
||||
QComboBox * changeLang = new QComboBox( lang_tw );
|
||||
changeLang->move( XDelta, YDelta );
|
||||
|
||||
QDir dir( ConfigManager::inst()->localeDir() );
|
||||
QStringList fileNames = dir.entryList( QStringList( "*.qm" ) );
|
||||
for( int i = 0; i < fileNames.size(); ++i )
|
||||
{
|
||||
// get locale extracted by filename
|
||||
fileNames[i].truncate( fileNames[i].lastIndexOf( '.' ) );
|
||||
m_languages.append( fileNames[i] );
|
||||
QString lang = QLocale( m_languages.last() ).nativeLanguageName();
|
||||
changeLang->addItem( lang );
|
||||
}
|
||||
connect( changeLang, SIGNAL( currentIndexChanged( int ) ),
|
||||
this, SLOT( setLanguage( int ) ) );
|
||||
|
||||
//If language unset, fallback to system language when available
|
||||
if( m_lang == "" )
|
||||
{
|
||||
QString tmp = QLocale::system().name().left( 2 );
|
||||
if( m_languages.contains( tmp ) )
|
||||
{
|
||||
m_lang = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lang = "en";
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = 0; i < changeLang->count(); ++i )
|
||||
{
|
||||
if( m_lang == m_languages.at( i ) )
|
||||
{
|
||||
changeLang->setCurrentIndex( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gen_layout->addWidget( bufsize_tw );
|
||||
gen_layout->addSpacing( 10 );
|
||||
gen_layout->addWidget( misc_tw );
|
||||
gen_layout->addSpacing( 10 );
|
||||
gen_layout->addWidget( lang_tw );
|
||||
gen_layout->addStretch();
|
||||
|
||||
|
||||
@@ -806,6 +861,8 @@ void SetupDialog::accept()
|
||||
QString::number( m_displaydBV ) );
|
||||
ConfigManager::inst()->setValue( "app", "nommpz",
|
||||
QString::number( !m_MMPZ ) );
|
||||
ConfigManager::inst()->setValue( "app", "disablebackup",
|
||||
QString::number( !m_disableBackup ) );
|
||||
ConfigManager::inst()->setValue( "mixer", "hqaudio",
|
||||
QString::number( m_hqAudioDev ) );
|
||||
ConfigManager::inst()->setValue( "ui", "smoothscroll",
|
||||
@@ -826,6 +883,7 @@ void SetupDialog::accept()
|
||||
QString::number( m_displayWaveform ) );
|
||||
ConfigManager::inst()->setValue( "ui", "disableautoquit",
|
||||
QString::number( m_disableAutoQuit ) );
|
||||
ConfigManager::inst()->setValue( "app", "language", m_lang );
|
||||
|
||||
|
||||
ConfigManager::inst()->setWorkingDir( m_workingDir );
|
||||
@@ -958,6 +1016,14 @@ void SetupDialog::toggleMMPZ( bool _enabled )
|
||||
|
||||
|
||||
|
||||
void SetupDialog::toggleDisableBackup( bool _enabled )
|
||||
{
|
||||
m_disableBackup = _enabled;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SetupDialog::toggleHQAudioDev( bool _enabled )
|
||||
{
|
||||
m_hqAudioDev = _enabled;
|
||||
@@ -1026,6 +1092,11 @@ void SetupDialog::toggleOneInstrumentTrackWindow( bool _enabled )
|
||||
m_oneInstrumentTrackWindow = _enabled;
|
||||
}
|
||||
|
||||
void SetupDialog::setLanguage( int lang )
|
||||
{
|
||||
m_lang = m_languages[lang];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
#include "StringPairDrag.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ StringPairDrag::~StringPairDrag()
|
||||
{
|
||||
// during a drag, we might have lost key-press-events, so reset
|
||||
// modifiers of main-win
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->clearKeyModifiers();
|
||||
gui->mainWindow()->clearKeyModifiers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Timeline.cpp - class timeLine, representing a time-line with position marker
|
||||
* TimeLineWidget.cpp - class timeLine, representing a time-line with position marker
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -29,14 +29,15 @@
|
||||
#include <QLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QToolBar>
|
||||
|
||||
|
||||
#include "Timeline.h"
|
||||
#include "TimeLineWidget.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "templates.h"
|
||||
#include "NStateButton.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "TextFloat.h"
|
||||
|
||||
|
||||
@@ -45,24 +46,31 @@
|
||||
#endif
|
||||
|
||||
|
||||
QPixmap * Timeline::s_timeLinePixmap = NULL;
|
||||
QPixmap * Timeline::s_posMarkerPixmap = NULL;
|
||||
QPixmap * Timeline::s_loopPointBeginPixmap = NULL;
|
||||
QPixmap * Timeline::s_loopPointEndPixmap = NULL;
|
||||
QPixmap * TimeLineWidget::s_timeLinePixmap = NULL;
|
||||
QPixmap * TimeLineWidget::s_posMarkerPixmap = NULL;
|
||||
QPixmap * TimeLineWidget::s_loopPointBeginPixmap = NULL;
|
||||
QPixmap * TimeLineWidget::s_loopPointEndPixmap = NULL;
|
||||
|
||||
<<<<<<< HEAD:src/core/Timeline.cpp
|
||||
Timeline::Timeline( const int _xoff, const int _yoff, const float _ppt,
|
||||
Song::PlayPos & _pos, const MidiTime & _begin,
|
||||
QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
=======
|
||||
TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt,
|
||||
Song::PlayPos & pos, const MidiTime & begin,
|
||||
QWidget * parent ) :
|
||||
QWidget( parent ),
|
||||
>>>>>>> coding:src/gui/TimeLineWidget.cpp
|
||||
m_autoScroll( AutoScrollEnabled ),
|
||||
m_loopPoints( LoopPointsDisabled ),
|
||||
m_behaviourAtStop( BackToZero ),
|
||||
m_changedPosition( true ),
|
||||
m_xOffset( _xoff ),
|
||||
m_xOffset( xoff ),
|
||||
m_posMarkerX( 0 ),
|
||||
m_ppt( _ppt ),
|
||||
m_pos( _pos ),
|
||||
m_begin( _begin ),
|
||||
m_ppt( ppt ),
|
||||
m_pos( pos ),
|
||||
m_begin( begin ),
|
||||
m_savedPos( -1 ),
|
||||
m_hint( NULL ),
|
||||
m_action( NoAction ),
|
||||
@@ -93,25 +101,25 @@ Timeline::Timeline( const int _xoff, const int _yoff, const float _ppt,
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
move( 0, _yoff );
|
||||
move( 0, yoff );
|
||||
setFixedHeight( s_timeLinePixmap->height() );
|
||||
|
||||
m_xOffset -= s_posMarkerPixmap->width() / 2;
|
||||
|
||||
m_pos.m_timeLine = this;
|
||||
|
||||
QTimer * update_timer = new QTimer( this );
|
||||
connect( update_timer, SIGNAL( timeout() ),
|
||||
QTimer * updateTimer = new QTimer( this );
|
||||
connect( updateTimer, SIGNAL( timeout() ),
|
||||
this, SLOT( updatePosition() ) );
|
||||
update_timer->start( 50 );
|
||||
updateTimer->start( 50 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Timeline::~Timeline()
|
||||
TimeLineWidget::~TimeLineWidget()
|
||||
{
|
||||
if( Engine::songEditor() )
|
||||
if( gui->songEditor() )
|
||||
{
|
||||
m_pos.m_timeLine = NULL;
|
||||
}
|
||||
@@ -121,7 +129,7 @@ Timeline::~Timeline()
|
||||
|
||||
|
||||
|
||||
void Timeline::addToolButtons( QWidget * _tool_bar )
|
||||
void TimeLineWidget::addToolButtons( QToolBar * _tool_bar )
|
||||
{
|
||||
NStateButton * autoScroll = new NStateButton( _tool_bar );
|
||||
autoScroll->setGeneralToolTip( tr( "Enable/disable auto-scrolling" ) );
|
||||
@@ -152,16 +160,15 @@ void Timeline::addToolButtons( QWidget * _tool_bar )
|
||||
connect( behaviourAtStop, SIGNAL( changedState( int ) ), this,
|
||||
SLOT( toggleBehaviourAtStop( int ) ) );
|
||||
|
||||
QBoxLayout * layout = dynamic_cast<QBoxLayout *>( _tool_bar->layout() );
|
||||
layout->addWidget( autoScroll );
|
||||
layout->addWidget( loopPoints );
|
||||
layout->addWidget( behaviourAtStop );
|
||||
_tool_bar->addWidget( autoScroll );
|
||||
_tool_bar->addWidget( loopPoints );
|
||||
_tool_bar->addWidget( behaviourAtStop );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Timeline::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void TimeLineWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "lp0pos", (int) loopBegin() );
|
||||
_this.setAttribute( "lp1pos", (int) loopEnd() );
|
||||
@@ -171,7 +178,7 @@ void Timeline::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void Timeline::loadSettings( const QDomElement & _this )
|
||||
void TimeLineWidget::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_loopPos[0] = _this.attribute( "lp0pos" ).toInt();
|
||||
m_loopPos[1] = _this.attribute( "lp1pos" ).toInt();
|
||||
@@ -184,7 +191,7 @@ void Timeline::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void Timeline::updatePosition( const MidiTime & )
|
||||
void TimeLineWidget::updatePosition( const MidiTime & )
|
||||
{
|
||||
const int new_x = markerX( m_pos );
|
||||
|
||||
@@ -200,7 +207,7 @@ void Timeline::updatePosition( const MidiTime & )
|
||||
|
||||
|
||||
|
||||
void Timeline::toggleAutoScroll( int _n )
|
||||
void TimeLineWidget::toggleAutoScroll( int _n )
|
||||
{
|
||||
m_autoScroll = static_cast<AutoScrollStates>( _n );
|
||||
}
|
||||
@@ -208,7 +215,7 @@ void Timeline::toggleAutoScroll( int _n )
|
||||
|
||||
|
||||
|
||||
void Timeline::toggleLoopPoints( int _n )
|
||||
void TimeLineWidget::toggleLoopPoints( int _n )
|
||||
{
|
||||
m_loopPoints = static_cast<LoopPointStates>( _n );
|
||||
update();
|
||||
@@ -217,7 +224,7 @@ void Timeline::toggleLoopPoints( int _n )
|
||||
|
||||
|
||||
|
||||
void Timeline::toggleBehaviourAtStop( int _n )
|
||||
void TimeLineWidget::toggleBehaviourAtStop( int _n )
|
||||
{
|
||||
m_behaviourAtStop = static_cast<BehaviourAtStopStates>( _n );
|
||||
}
|
||||
@@ -225,7 +232,7 @@ void Timeline::toggleBehaviourAtStop( int _n )
|
||||
|
||||
|
||||
|
||||
void Timeline::paintEvent( QPaintEvent * )
|
||||
void TimeLineWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
|
||||
@@ -274,7 +281,7 @@ void Timeline::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
|
||||
void Timeline::mousePressEvent( QMouseEvent* event )
|
||||
void TimeLineWidget::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
if( event->x() < m_xOffset )
|
||||
{
|
||||
@@ -332,7 +339,7 @@ void Timeline::mousePressEvent( QMouseEvent* event )
|
||||
|
||||
|
||||
|
||||
void Timeline::mouseMoveEvent( QMouseEvent* event )
|
||||
void TimeLineWidget::mouseMoveEvent( QMouseEvent* event )
|
||||
{
|
||||
const MidiTime t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * MidiTime::ticksPerTact() / m_ppt );
|
||||
|
||||
@@ -382,7 +389,7 @@ void Timeline::mouseMoveEvent( QMouseEvent* event )
|
||||
|
||||
|
||||
|
||||
void Timeline::mouseReleaseEvent( QMouseEvent* event )
|
||||
void TimeLineWidget::mouseReleaseEvent( QMouseEvent* event )
|
||||
{
|
||||
delete m_hint;
|
||||
m_hint = NULL;
|
||||
@@ -31,13 +31,14 @@
|
||||
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) :
|
||||
PluginView( _toolPlugin, NULL )
|
||||
{
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
|
||||
setWindowTitle( _toolPlugin->displayName() );
|
||||
|
||||
@@ -325,7 +325,9 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
Track::create( Track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
it->loadInstrument( value );
|
||||
InstrumentLoaderThread *ilt = new InstrumentLoaderThread(
|
||||
this, it, value );
|
||||
ilt->start();
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
@@ -453,6 +455,22 @@ void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
|
||||
|
||||
InstrumentLoaderThread::InstrumentLoaderThread( QObject *parent, InstrumentTrack *it, QString name ) :
|
||||
QThread( parent ),
|
||||
m_it( it ),
|
||||
m_name( name )
|
||||
{
|
||||
m_containerThread = thread();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void InstrumentLoaderThread::run()
|
||||
{
|
||||
Instrument *i = m_it->loadInstrument( m_name );
|
||||
QObject *parent = i->parent();
|
||||
i->setParent( 0 );
|
||||
i->moveToThread( m_containerThread );
|
||||
i->setParent( parent );
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "embed.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
#include "ToolButton.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "DataFile.h"
|
||||
#include "StringPairDrag.h"
|
||||
@@ -44,27 +43,18 @@
|
||||
|
||||
|
||||
BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
TrackContainerView( tc ),
|
||||
m_bbtc( tc )
|
||||
Editor(false),
|
||||
m_trackContainerView( new BBTrackContainerView(tc) )
|
||||
{
|
||||
// create toolbar
|
||||
m_toolBar = new QWidget;
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
m_toolBar->setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, m_toolBar );
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setSpacing( 0 );
|
||||
tb_layout->setMargin( 0 );
|
||||
|
||||
|
||||
setWindowIcon( embed::getIconPixmap( "bb_track_btn" ) );
|
||||
setWindowTitle( tr( "Beat+Bassline Editor" ) );
|
||||
setCentralWidget(m_trackContainerView);
|
||||
|
||||
setAcceptDrops(true);
|
||||
m_toolBar->setAcceptDrops(true);
|
||||
connect(m_toolBar, SIGNAL(dragEntered(QDragEnterEvent*)), m_trackContainerView, SLOT(dragEnterEvent(QDragEnterEvent*)));
|
||||
connect(m_toolBar, SIGNAL(dropped(QDropEvent*)), m_trackContainerView, SLOT(dropEvent(QDropEvent*)));
|
||||
|
||||
// TODO: Use style sheet
|
||||
if( ConfigManager::inst()->value( "ui",
|
||||
"compacttrackbuttons" ).toInt() )
|
||||
@@ -79,45 +69,14 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
}
|
||||
|
||||
|
||||
m_playButton = new ToolButton( embed::getIconPixmap( "play" ),
|
||||
tr( "Play/pause current beat/bassline (Space)" ),
|
||||
this, SLOT( play() ), m_toolBar );
|
||||
m_playAction->setToolTip(tr( "Play/pause current beat/bassline (Space)" ));
|
||||
m_stopAction->setToolTip(tr( "Stop playback of current beat/bassline (Space)" ));
|
||||
|
||||
m_stopButton = new ToolButton( embed::getIconPixmap( "stop" ),
|
||||
tr( "Stop playback of current beat/bassline (Space)" ),
|
||||
this, SLOT( stop() ), m_toolBar );
|
||||
|
||||
m_playButton->setObjectName( "playButton" );
|
||||
m_stopButton->setObjectName( "stopButton" );
|
||||
|
||||
ToolButton * add_bb_track = new ToolButton(
|
||||
embed::getIconPixmap( "add_bb_track" ),
|
||||
tr( "Add beat/bassline" ),
|
||||
Engine::getSong(), SLOT( addBBTrack() ),
|
||||
m_toolBar );
|
||||
|
||||
ToolButton * add_automation_track = new ToolButton(
|
||||
embed::getIconPixmap( "add_automation" ),
|
||||
tr( "Add automation-track" ),
|
||||
this, SLOT( addAutomationTrack() ), m_toolBar );
|
||||
|
||||
ToolButton * remove_bar = new ToolButton(
|
||||
embed::getIconPixmap( "step_btn_remove" ),
|
||||
tr( "Remove steps" ),
|
||||
this, SLOT( removeSteps() ), m_toolBar );
|
||||
|
||||
ToolButton * add_bar = new ToolButton(
|
||||
embed::getIconPixmap( "step_btn_add" ),
|
||||
tr( "Add steps" ),
|
||||
this, SLOT( addSteps() ), m_toolBar );
|
||||
|
||||
|
||||
|
||||
m_playButton->setWhatsThis(
|
||||
m_playAction->setWhatsThis(
|
||||
tr( "Click here to play the current "
|
||||
"beat/bassline. The beat/bassline is automatically "
|
||||
"looped when its end is reached." ) );
|
||||
m_stopButton->setWhatsThis(
|
||||
m_stopAction->setWhatsThis(
|
||||
tr( "Click here to stop playing of current "
|
||||
"beat/bassline." ) );
|
||||
|
||||
@@ -125,88 +84,57 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
m_bbComboBox->setFixedSize( 200, 22 );
|
||||
m_bbComboBox->setModel( &tc->m_bbComboBoxModel );
|
||||
|
||||
tb_layout->addSpacing( 5 );
|
||||
tb_layout->addWidget( m_playButton );
|
||||
tb_layout->addWidget( m_stopButton );
|
||||
tb_layout->addSpacing( 20 );
|
||||
tb_layout->addWidget( m_bbComboBox );
|
||||
tb_layout->addSpacing( 10 );
|
||||
tb_layout->addWidget( add_bb_track );
|
||||
tb_layout->addWidget( add_automation_track );
|
||||
tb_layout->addStretch();
|
||||
tb_layout->addWidget( remove_bar );
|
||||
tb_layout->addWidget( add_bar );
|
||||
tb_layout->addSpacing( 15 );
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( m_bbComboBox );
|
||||
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->layout()->setSizeConstraint( QLayout::SetMinimumSize );
|
||||
parentWidget()->resize( minimumWidth(), 300 );
|
||||
parentWidget()->move( 610, 5 );
|
||||
parentWidget()->show();
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addAction(embed::getIconPixmap("add_bb_track"), tr("Add beat/bassline"),
|
||||
Engine::getSong(), SLOT(addBBTrack()));
|
||||
m_toolBar->addAction(embed::getIconPixmap("add_automation"), tr("Add automation-track"),
|
||||
m_trackContainerView, SLOT(addAutomationTrack()));
|
||||
|
||||
QWidget* stretch = new QWidget(m_toolBar);
|
||||
stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
m_toolBar->addWidget(stretch);
|
||||
|
||||
m_toolBar->addAction(embed::getIconPixmap("step_btn_remove"), tr("Remove steps"),
|
||||
m_trackContainerView, SLOT(removeSteps()));
|
||||
m_toolBar->addAction(embed::getIconPixmap("step_btn_add"), tr("Add steps"),
|
||||
m_trackContainerView, SLOT(addSteps()));
|
||||
m_toolBar->addSeparator();
|
||||
|
||||
setModel( tc );
|
||||
connect( &tc->m_bbComboBoxModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( updatePosition() ) );
|
||||
m_trackContainerView, SLOT( updatePosition() ) );
|
||||
|
||||
QAction* viewNext = new QAction(this);
|
||||
connect(viewNext, SIGNAL(triggered()), m_bbComboBox, SLOT(selectNext()));
|
||||
viewNext->setShortcut(Qt::Key_Plus);
|
||||
addAction(viewNext);
|
||||
|
||||
QAction* viewPrevious = new QAction(this);
|
||||
connect(viewPrevious, SIGNAL(triggered()), m_bbComboBox, SLOT(selectPrevious()));
|
||||
viewPrevious->setShortcut(Qt::Key_Minus);
|
||||
addAction(viewPrevious);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BBEditor::~BBEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void BBEditor::dropEvent( QDropEvent * de )
|
||||
QSize BBEditor::sizeHint() const
|
||||
{
|
||||
QString type = StringPairDrag::decodeKey( de );
|
||||
QString value = StringPairDrag::decodeValue( de );
|
||||
|
||||
if( type.left( 6 ) == "track_" )
|
||||
{
|
||||
DataFile dataFile( value.toUtf8() );
|
||||
Track * t = Track::create( dataFile.content().firstChild().toElement(), model() );
|
||||
|
||||
t->deleteTCOs();
|
||||
m_bbtc->updateAfterTrackAdd();
|
||||
|
||||
de->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
TrackContainerView::dropEvent( de );
|
||||
}
|
||||
return {minimumWidth()+10, 300};
|
||||
}
|
||||
|
||||
|
||||
void BBEditor::removeBBView( int _bb )
|
||||
void BBEditor::removeBBView( int bb )
|
||||
{
|
||||
foreach( TrackView* view, trackViews() )
|
||||
{
|
||||
view->getTrackContentWidget()->removeTCOView( _bb );
|
||||
}
|
||||
m_trackContainerView->removeBBView(bb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBEditor::setPauseIcon( bool pause )
|
||||
{
|
||||
if( pause == true )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBEditor::play()
|
||||
{
|
||||
if( Engine::getSong()->playMode() != Song::Mode_PlayBB )
|
||||
@@ -220,8 +148,6 @@ void BBEditor::play()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBEditor::stop()
|
||||
{
|
||||
Engine::getSong()->stop();
|
||||
@@ -230,24 +156,21 @@ void BBEditor::stop()
|
||||
|
||||
|
||||
|
||||
void BBEditor::updatePosition()
|
||||
|
||||
|
||||
BBTrackContainerView::BBTrackContainerView(BBTrackContainer* tc) :
|
||||
TrackContainerView(tc),
|
||||
m_bbtc(tc)
|
||||
{
|
||||
//realignTracks();
|
||||
emit positionChanged( m_currentPosition );
|
||||
setModel( tc );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBEditor::addAutomationTrack()
|
||||
{
|
||||
(void) Track::create( Track::AutomationTrack, model() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBEditor::addSteps()
|
||||
void BBTrackContainerView::addSteps()
|
||||
{
|
||||
TrackContainer::TrackList tl = model()->tracks();
|
||||
|
||||
@@ -265,7 +188,7 @@ void BBEditor::addSteps()
|
||||
|
||||
|
||||
|
||||
void BBEditor::removeSteps()
|
||||
void BBTrackContainerView::removeSteps()
|
||||
{
|
||||
TrackContainer::TrackList tl = model()->tracks();
|
||||
|
||||
@@ -283,44 +206,54 @@ void BBEditor::removeSteps()
|
||||
|
||||
|
||||
|
||||
void BBEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
void BBTrackContainerView::addAutomationTrack()
|
||||
{
|
||||
if ( _ke->key() == Qt::Key_Space )
|
||||
{
|
||||
if( Engine::getSong()->isPlaying() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
play();
|
||||
}
|
||||
}
|
||||
else if ( _ke->key() == Qt::Key_Plus )
|
||||
{
|
||||
if( m_bbtc->currentBB()+ 1 < m_bbtc->numOfBBs() )
|
||||
{
|
||||
m_bbtc->setCurrentBB( m_bbtc->currentBB() + 1 );
|
||||
}
|
||||
}
|
||||
else if ( _ke->key() == Qt::Key_Minus )
|
||||
{
|
||||
if( m_bbtc->currentBB() > 0 )
|
||||
{
|
||||
m_bbtc->setCurrentBB( m_bbtc->currentBB() - 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// ignore event and pass to parent-widget
|
||||
_ke->ignore();
|
||||
}
|
||||
|
||||
(void) Track::create( Track::AutomationTrack, model() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBTrackContainerView::removeBBView(int bb)
|
||||
{
|
||||
foreach( TrackView* view, trackViews() )
|
||||
{
|
||||
view->getTrackContentWidget()->removeTCOView( bb );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBTrackContainerView::dropEvent(QDropEvent* de)
|
||||
{
|
||||
QString type = StringPairDrag::decodeKey( de );
|
||||
QString value = StringPairDrag::decodeValue( de );
|
||||
|
||||
if( type.left( 6 ) == "track_" )
|
||||
{
|
||||
DataFile dataFile( value.toUtf8() );
|
||||
Track * t = Track::create( dataFile.content().firstChild().toElement(), model() );
|
||||
|
||||
t->deleteTCOs();
|
||||
m_bbtc->updateAfterTrackAdd();
|
||||
|
||||
de->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
TrackContainerView::dropEvent( de );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BBTrackContainerView::updatePosition()
|
||||
{
|
||||
//realignTracks();
|
||||
emit positionChanged( m_currentPosition );
|
||||
}
|
||||
|
||||
void BBEditor::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
116
src/gui/editors/Editor.cpp
Normal file
116
src/gui/editors/Editor.cpp
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Editor.cpp - implementation of Editor class
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Editor.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QMdiArea>
|
||||
#include <QShortcut>
|
||||
|
||||
|
||||
void Editor::setPauseIcon(bool displayPauseIcon)
|
||||
{
|
||||
// If we're playing, show a pause icon
|
||||
if (displayPauseIcon)
|
||||
m_playAction->setIcon(embed::getIconPixmap("pause"));
|
||||
else
|
||||
m_playAction->setIcon(embed::getIconPixmap("play"));
|
||||
}
|
||||
|
||||
void Editor::togglePlayStop()
|
||||
{
|
||||
if (Engine::getSong()->isPlaying())
|
||||
stop();
|
||||
else
|
||||
play();
|
||||
}
|
||||
|
||||
Editor::Editor(bool record) :
|
||||
m_toolBar(new DropToolBar(this)),
|
||||
m_playAction(nullptr),
|
||||
m_recordAction(nullptr),
|
||||
m_recordAccompanyAction(nullptr),
|
||||
m_stopAction(nullptr)
|
||||
{
|
||||
m_toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
|
||||
m_toolBar->setMovable(false);
|
||||
|
||||
auto addButton = [this](QAction* action, QString objectName) {
|
||||
m_toolBar->addAction(action);
|
||||
m_toolBar->widgetForAction(action)->setObjectName(objectName);
|
||||
};
|
||||
|
||||
// Set up play and record actions
|
||||
m_playAction = new QAction(embed::getIconPixmap("play"), tr("Play (Space)"), this);
|
||||
m_stopAction = new QAction(embed::getIconPixmap("stop"), tr("Stop (Space)"), this);
|
||||
|
||||
m_recordAction = new QAction(embed::getIconPixmap("record"), tr("Record"), this);
|
||||
m_recordAccompanyAction = new QAction(embed::getIconPixmap("record_accompany"), tr("Record while playing"), this);
|
||||
|
||||
// Set up connections
|
||||
connect(m_playAction, SIGNAL(triggered()), this, SLOT(play()));
|
||||
connect(m_recordAction, SIGNAL(triggered()), this, SLOT(record()));
|
||||
connect(m_recordAccompanyAction, SIGNAL(triggered()), this, SLOT(recordAccompany()));
|
||||
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop()));
|
||||
new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop()));
|
||||
|
||||
// Add toolbar to window
|
||||
addToolBar(Qt::TopToolBarArea, m_toolBar);
|
||||
|
||||
// Add actions to toolbar
|
||||
addButton(m_playAction, "playButton");
|
||||
if (record)
|
||||
{
|
||||
addButton(m_recordAction, "recordButton");
|
||||
addButton(m_recordAccompanyAction, "recordAccompanyButton");
|
||||
}
|
||||
addButton(m_stopAction, "stopButton");
|
||||
}
|
||||
|
||||
Editor::~Editor()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DropToolBar::DropToolBar(QWidget* parent) : QToolBar(parent)
|
||||
{
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
||||
void DropToolBar::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
dragEntered(event);
|
||||
}
|
||||
|
||||
void DropToolBar::dropEvent(QDropEvent* event)
|
||||
{
|
||||
dropped(event);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QTimeLine>
|
||||
#include <QAction>
|
||||
#include <QButtonGroup>
|
||||
@@ -35,18 +37,18 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "SongEditor.h"
|
||||
#include "ActionGroup.h"
|
||||
#include "AutomatableSlider.h"
|
||||
#include "ComboBox.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "CPULoadWidget.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LcdSpinBox.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "TextFloat.h"
|
||||
#include "Timeline.h"
|
||||
#include "ToolButton.h"
|
||||
#include "TimeLineWidget.h"
|
||||
#include "ToolTip.h"
|
||||
#include "VisualizationWidget.h"
|
||||
#include "TimeDisplayWidget.h"
|
||||
@@ -77,21 +79,17 @@ void positionLine::paintEvent( QPaintEvent * _pe )
|
||||
SongEditor::SongEditor( Song * _song ) :
|
||||
TrackContainerView( _song ),
|
||||
m_song( _song ),
|
||||
m_zoomingModel(new ComboBoxModel()),
|
||||
m_scrollBack( false ),
|
||||
m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() )
|
||||
m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ),
|
||||
m_mode(DrawMode)
|
||||
{
|
||||
setWindowTitle( tr( "Song-Editor" ) );
|
||||
setWindowIcon( embed::getIconPixmap( "songeditor" ) );
|
||||
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setFocus();
|
||||
|
||||
// create time-line
|
||||
int widgetTotal = ConfigManager::inst()->value( "ui",
|
||||
"compacttrackbuttons" ).toInt()==1 ?
|
||||
DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT + TRACK_OP_WIDTH_COMPACT :
|
||||
DEFAULT_SETTINGS_WIDGET_WIDTH + TRACK_OP_WIDTH;
|
||||
m_timeLine = new Timeline( widgetTotal, 32,
|
||||
m_timeLine = new TimeLineWidget( widgetTotal, 32,
|
||||
pixelsPerTact(),
|
||||
m_song->m_playPos[Song::Mode_PlaySong],
|
||||
m_currentPosition, this );
|
||||
@@ -103,16 +101,13 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
|
||||
m_positionLine = new positionLine( this );
|
||||
|
||||
|
||||
// let's get notified when loading a project
|
||||
connect( m_song, SIGNAL( projectLoaded() ),
|
||||
this, SLOT( adjustUiAfterProjectLoad() ) );
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 1, m_timeLine );
|
||||
|
||||
|
||||
// add some essential widgets to global tool-bar
|
||||
QWidget * tb = Engine::mainWindow()->toolBar();
|
||||
QWidget * tb = gui->mainWindow()->toolBar();
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
m_tempoSpinBox = new LcdSpinBox( 3, tb, tr( "Tempo" ) );
|
||||
m_tempoSpinBox->setModel( &m_song->m_tempoModel );
|
||||
@@ -127,7 +122,7 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
"should be played within a minute (or how many measures "
|
||||
"should be played within four minutes)." ) );
|
||||
|
||||
int tempoSpinBoxCol = Engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
int tempoSpinBoxCol = gui->mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
|
||||
#if 0
|
||||
toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ),
|
||||
@@ -137,18 +132,18 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
connect( hq_btn, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( setHighQuality( bool ) ) );
|
||||
hq_btn->setFixedWidth( 42 );
|
||||
Engine::mainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
gui->mainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
#endif
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol );
|
||||
gui->mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
m_timeSigDisplay = new MeterDialog( this, true );
|
||||
m_timeSigDisplay->setModel( &m_song->m_timeSigModel );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_vol_lbl = new QLabel( tb );
|
||||
@@ -165,23 +160,23 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
ToolTip::add( m_masterVolumeSlider, tr( "master volume" ) );
|
||||
|
||||
connect( m_masterVolumeSlider, SIGNAL( logicValueChanged( int ) ), this,
|
||||
SLOT( masterVolumeChanged( int ) ) );
|
||||
SLOT( setMasterVolume( int ) ) );
|
||||
connect( m_masterVolumeSlider, SIGNAL( sliderPressed() ), this,
|
||||
SLOT( masterVolumePressed() ) );
|
||||
SLOT( showMasterVolumeFloat()) );
|
||||
connect( m_masterVolumeSlider, SIGNAL( logicSliderMoved( int ) ), this,
|
||||
SLOT( masterVolumeMoved( int ) ) );
|
||||
SLOT( updateMasterVolumeFloat( int ) ) );
|
||||
connect( m_masterVolumeSlider, SIGNAL( sliderReleased() ), this,
|
||||
SLOT( masterVolumeReleased() ) );
|
||||
SLOT( hideMasterVolumeFloat() ) );
|
||||
|
||||
m_mvsStatus = new TextFloat;
|
||||
m_mvsStatus->setTitle( tr( "Master volume" ) );
|
||||
m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) );
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
gui->mainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_pitch_lbl = new QLabel( tb );
|
||||
@@ -197,22 +192,22 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
m_masterPitchSlider->setTickInterval( 12 );
|
||||
ToolTip::add( m_masterPitchSlider, tr( "master pitch" ) );
|
||||
connect( m_masterPitchSlider, SIGNAL( logicValueChanged( int ) ), this,
|
||||
SLOT( masterPitchChanged( int ) ) );
|
||||
SLOT( setMasterPitch( int ) ) );
|
||||
connect( m_masterPitchSlider, SIGNAL( sliderPressed() ), this,
|
||||
SLOT( masterPitchPressed() ) );
|
||||
SLOT( showMasterPitchFloat() ) );
|
||||
connect( m_masterPitchSlider, SIGNAL( logicSliderMoved( int ) ), this,
|
||||
SLOT( masterPitchMoved( int ) ) );
|
||||
SLOT( updateMasterPitchFloat( int ) ) );
|
||||
connect( m_masterPitchSlider, SIGNAL( sliderReleased() ), this,
|
||||
SLOT( masterPitchReleased() ) );
|
||||
SLOT( hideMasterPitchFloat() ) );
|
||||
|
||||
m_mpsStatus = new TextFloat;
|
||||
m_mpsStatus->setTitle( tr( "Master pitch" ) );
|
||||
m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) );
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
gui->mainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
// create widget for visualization- and cpu-load-widget
|
||||
QWidget * vc_w = new QWidget( tb );
|
||||
@@ -227,156 +222,9 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
vcw_layout->addWidget( new CPULoadWidget( vc_w ) );
|
||||
vcw_layout->addStretch();
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( vc_w );
|
||||
|
||||
|
||||
// create own toolbar
|
||||
m_toolBar = new QWidget( this );
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, m_toolBar );
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 1, m_timeLine );
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
tb_layout->setSpacing( 0 );
|
||||
|
||||
|
||||
// fill own tool-bar
|
||||
m_playButton = new ToolButton( embed::getIconPixmap( "play" ),
|
||||
tr( "Play song (Space)" ),
|
||||
this, SLOT( play() ), m_toolBar );
|
||||
m_playButton->setObjectName( "playButton" );
|
||||
|
||||
m_recordButton = new ToolButton( embed::getIconPixmap( "record" ),
|
||||
tr( "Record samples from Audio-device" ),
|
||||
this, SLOT( record() ), m_toolBar );
|
||||
m_recordButton->setObjectName( "recordButton" );
|
||||
|
||||
m_recordAccompanyButton = new ToolButton(
|
||||
embed::getIconPixmap( "record_accompany" ),
|
||||
tr( "Record samples from Audio-device while playing "
|
||||
"song or BB track" ),
|
||||
this, SLOT( recordAccompany() ), m_toolBar );
|
||||
m_recordAccompanyButton->setObjectName( "recordAccompanyButton" );
|
||||
|
||||
// FIXME: disable record button while it is not implemented
|
||||
m_recordButton->setDisabled( true );
|
||||
|
||||
// disable record buttons if capturing is not supported
|
||||
if( !Engine::mixer()->audioDev()->supportsCapture() )
|
||||
{
|
||||
m_recordButton->setDisabled( true );
|
||||
m_recordAccompanyButton->setDisabled( true );
|
||||
}
|
||||
|
||||
m_stopButton = new ToolButton( embed::getIconPixmap( "stop" ),
|
||||
tr( "Stop song (Space)" ),
|
||||
this, SLOT( stop() ), m_toolBar );
|
||||
m_stopButton->setObjectName( "stopButton" );
|
||||
|
||||
m_addBBTrackButton = new ToolButton( embed::getIconPixmap(
|
||||
"add_bb_track" ),
|
||||
tr( "Add beat/bassline" ),
|
||||
m_song, SLOT( addBBTrack() ),
|
||||
m_toolBar );
|
||||
|
||||
m_addSampleTrackButton = new ToolButton( embed::getIconPixmap(
|
||||
"add_sample_track" ),
|
||||
tr( "Add sample-track" ),
|
||||
m_song, SLOT( addSampleTrack() ),
|
||||
m_toolBar );
|
||||
|
||||
m_addAutomationTrackButton = new ToolButton( embed::getIconPixmap(
|
||||
"add_automation" ),
|
||||
tr( "Add automation-track" ),
|
||||
m_song, SLOT( addAutomationTrack() ),
|
||||
m_toolBar );
|
||||
|
||||
m_drawModeButton = new ToolButton( embed::getIconPixmap(
|
||||
"edit_draw" ),
|
||||
tr( "Draw mode" ),
|
||||
NULL, NULL, m_toolBar );
|
||||
m_drawModeButton->setCheckable( true );
|
||||
m_drawModeButton->setChecked( true );
|
||||
|
||||
m_editModeButton = new ToolButton( embed::getIconPixmap(
|
||||
"edit_select" ),
|
||||
tr( "Edit mode (select and move)" ),
|
||||
NULL, NULL, m_toolBar );
|
||||
m_editModeButton->setCheckable( true );
|
||||
|
||||
QButtonGroup * tool_button_group = new QButtonGroup( this );
|
||||
tool_button_group->addButton( m_drawModeButton );
|
||||
tool_button_group->addButton( m_editModeButton );
|
||||
tool_button_group->setExclusive( true );
|
||||
|
||||
#if 0
|
||||
#warning TODO
|
||||
QWhatsThis::add( m_playButton, tr( "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." ) );
|
||||
QWhatsThis::add( m_stopButton, tr ( "Click here, if you want to stop "
|
||||
"playing of your song. The "
|
||||
"song-position-marker will be "
|
||||
"set to the start of your song."
|
||||
) );
|
||||
/* QWhatsThis::add( m_insertBarButton, tr( "If you click here, a "
|
||||
"bar will "
|
||||
"be inserted at the "
|
||||
"current bar." ) );
|
||||
QWhatsThis::add( m_removeBarButton, tr( "If you click here, the "
|
||||
"current bar will be "
|
||||
"removed." ) );*/
|
||||
#endif
|
||||
|
||||
|
||||
QLabel * zoom_lbl = new QLabel( m_toolBar );
|
||||
zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) );
|
||||
|
||||
// setup zooming-stuff
|
||||
m_zoomingComboBox = new ComboBox( m_toolBar );
|
||||
m_zoomingComboBox->setFixedSize( 80, 22 );
|
||||
m_zoomingComboBox->move( 580, 4 );
|
||||
for( int i = 0; i < 7; ++i )
|
||||
{
|
||||
m_zoomingComboBox->model()->addItem(
|
||||
QString::number( 25 << i ) + "%" );
|
||||
}
|
||||
m_zoomingComboBox->model()->setInitValue(
|
||||
m_zoomingComboBox->model()->findText( "100%" ) );
|
||||
connect( m_zoomingComboBox->model(), SIGNAL( dataChanged() ),
|
||||
this, SLOT( zoomingChanged() ) );
|
||||
|
||||
|
||||
tb_layout->addSpacing( 5 );
|
||||
tb_layout->addWidget( m_playButton );
|
||||
tb_layout->addWidget( m_recordButton );
|
||||
tb_layout->addWidget( m_recordAccompanyButton );
|
||||
tb_layout->addWidget( m_stopButton );
|
||||
tb_layout->addSpacing( 10 );
|
||||
tb_layout->addWidget( m_addBBTrackButton );
|
||||
tb_layout->addWidget( m_addSampleTrackButton );
|
||||
tb_layout->addWidget( m_addAutomationTrackButton );
|
||||
tb_layout->addSpacing( 10 );
|
||||
tb_layout->addWidget( m_drawModeButton );
|
||||
tb_layout->addWidget( m_editModeButton );
|
||||
tb_layout->addSpacing( 10 );
|
||||
m_timeLine->addToolButtons( m_toolBar );
|
||||
tb_layout->addSpacing( 15 );
|
||||
tb_layout->addWidget( zoom_lbl );
|
||||
tb_layout->addSpacing( 5 );
|
||||
tb_layout->addWidget( m_zoomingComboBox );
|
||||
tb_layout->addStretch();
|
||||
gui->mainWindow()->addWidgetToToolBar( vc_w );
|
||||
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, m_timeLine );
|
||||
|
||||
m_leftRightScroll = new QScrollBar( Qt::Horizontal, this );
|
||||
m_leftRightScroll->setMinimum( 0 );
|
||||
@@ -389,12 +237,19 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
connect( m_song, SIGNAL( lengthChanged( int ) ),
|
||||
this, SLOT( updateScrollBar( int ) ) );
|
||||
|
||||
// Set up zooming model
|
||||
for( int i = 0; i < 7; ++i )
|
||||
{
|
||||
m_zoomingModel->addItem(
|
||||
QString::number( 25 << i ) + "%" );
|
||||
}
|
||||
m_zoomingModel->setInitValue(
|
||||
m_zoomingModel->findText( "100%" ) );
|
||||
connect( m_zoomingModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( zoomingChanged() ) );
|
||||
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->resize( 600, 300 );
|
||||
parentWidget()->move( 5, 5 );
|
||||
parentWidget()->show();
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -404,6 +259,16 @@ SongEditor::~SongEditor()
|
||||
{
|
||||
}
|
||||
|
||||
void SongEditor::saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
{
|
||||
MainWindow::saveWidgetState(parentWidget(), element);
|
||||
}
|
||||
|
||||
void SongEditor::loadSettings( const QDomElement& element )
|
||||
{
|
||||
MainWindow::restoreWidgetState(parentWidget(), element);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -426,56 +291,19 @@ void SongEditor::scrolled( int _new_pos )
|
||||
|
||||
|
||||
|
||||
void SongEditor::setPauseIcon( bool pause )
|
||||
void SongEditor::setEditMode(EditMode mode)
|
||||
{
|
||||
if( pause == true )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
m_mode = mode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::play()
|
||||
void SongEditor::setEditModeDraw()
|
||||
{
|
||||
if( Engine::getSong()->playMode() != Song::Mode_PlaySong )
|
||||
{
|
||||
Engine::getSong()->playSong();
|
||||
}
|
||||
else
|
||||
{
|
||||
Engine::getSong()->togglePause();
|
||||
}
|
||||
setEditMode(DrawMode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::record()
|
||||
void SongEditor::setEditModeSelect()
|
||||
{
|
||||
m_song->record();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::recordAccompany()
|
||||
{
|
||||
m_song->playAndRecord();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::stop()
|
||||
{
|
||||
m_song->stop();
|
||||
Engine::pianoRoll()->stopRecording();
|
||||
setEditMode(SelectMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -484,13 +312,13 @@ void SongEditor::stop()
|
||||
void SongEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( /*_ke->modifiers() & Qt::ShiftModifier*/
|
||||
Engine::mainWindow()->isShiftPressed() == true &&
|
||||
gui->mainWindow()->isShiftPressed() == true &&
|
||||
_ke->key() == Qt::Key_Insert )
|
||||
{
|
||||
m_song->insertBar();
|
||||
}
|
||||
else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/
|
||||
Engine::mainWindow()->isShiftPressed() == true &&
|
||||
gui->mainWindow()->isShiftPressed() == true &&
|
||||
_ke->key() == Qt::Key_Delete )
|
||||
{
|
||||
m_song->removeBar();
|
||||
@@ -511,17 +339,6 @@ void SongEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
m_song->setPlayPos( t, Song::Mode_PlaySong );
|
||||
}
|
||||
}
|
||||
else if( _ke->key() == Qt::Key_Space )
|
||||
{
|
||||
if( m_song->isPlaying() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
play();
|
||||
}
|
||||
}
|
||||
else if( _ke->key() == Qt::Key_Home )
|
||||
{
|
||||
m_song->setPlayPos( 0, Song::Mode_PlaySong );
|
||||
@@ -537,7 +354,7 @@ void SongEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
void SongEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( Engine::mainWindow()->isCtrlPressed() == true )
|
||||
if( gui->mainWindow()->isCtrlPressed() == true )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
@@ -549,8 +366,8 @@ void SongEditor::wheelEvent( QWheelEvent * _we )
|
||||
setPixelsPerTact( (int) pixelsPerTact() / 2 );
|
||||
}
|
||||
// update combobox with zooming-factor
|
||||
m_zoomingComboBox->model()->setValue(
|
||||
m_zoomingComboBox->model()->findText(
|
||||
m_zoomingModel->setValue(
|
||||
m_zoomingModel->findText(
|
||||
QString::number(
|
||||
static_cast<int>( pixelsPerTact() *
|
||||
100 / DEFAULT_PIXELS_PER_TACT ) ) +
|
||||
@@ -561,7 +378,7 @@ void SongEditor::wheelEvent( QWheelEvent * _we )
|
||||
// and make sure, all TCO's are resized and relocated
|
||||
realignTracks();
|
||||
}
|
||||
else if( Engine::mainWindow()->isShiftPressed() == true )
|
||||
else if( gui->mainWindow()->isShiftPressed() == true )
|
||||
{
|
||||
m_leftRightScroll->setValue( m_leftRightScroll->value() -
|
||||
_we->delta() / 30 );
|
||||
@@ -592,9 +409,8 @@ void SongEditor::closeEvent( QCloseEvent * _ce )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterVolumeChanged( int _new_val )
|
||||
void SongEditor::setMasterVolume( int _new_val )
|
||||
{
|
||||
masterVolumeMoved( _new_val );
|
||||
if( m_mvsStatus->isVisible() == false && m_song->m_loadingProject == false
|
||||
&& m_masterVolumeSlider->showStatus() )
|
||||
{
|
||||
@@ -608,18 +424,18 @@ void SongEditor::masterVolumeChanged( int _new_val )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterVolumePressed( void )
|
||||
void SongEditor::showMasterVolumeFloat( void )
|
||||
{
|
||||
m_mvsStatus->moveGlobal( m_masterVolumeSlider,
|
||||
QPoint( m_masterVolumeSlider->width() + 2, -2 ) );
|
||||
m_mvsStatus->show();
|
||||
masterVolumeMoved( m_song->m_masterVolumeModel.value() );
|
||||
updateMasterVolumeFloat( m_song->m_masterVolumeModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterVolumeMoved( int _new_val )
|
||||
void SongEditor::updateMasterVolumeFloat( int _new_val )
|
||||
{
|
||||
m_mvsStatus->setText( tr( "Value: %1%" ).arg( _new_val ) );
|
||||
}
|
||||
@@ -627,7 +443,7 @@ void SongEditor::masterVolumeMoved( int _new_val )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterVolumeReleased( void )
|
||||
void SongEditor::hideMasterVolumeFloat( void )
|
||||
{
|
||||
m_mvsStatus->hide();
|
||||
}
|
||||
@@ -635,9 +451,9 @@ void SongEditor::masterVolumeReleased( void )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterPitchChanged( int _new_val )
|
||||
void SongEditor::setMasterPitch( int _new_val )
|
||||
{
|
||||
masterPitchMoved( _new_val );
|
||||
updateMasterPitchFloat( _new_val );
|
||||
if( m_mpsStatus->isVisible() == false && m_song->m_loadingProject == false
|
||||
&& m_masterPitchSlider->showStatus() )
|
||||
{
|
||||
@@ -650,18 +466,18 @@ void SongEditor::masterPitchChanged( int _new_val )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterPitchPressed( void )
|
||||
void SongEditor::showMasterPitchFloat( void )
|
||||
{
|
||||
m_mpsStatus->moveGlobal( m_masterPitchSlider,
|
||||
QPoint( m_masterPitchSlider->width() + 2, -2 ) );
|
||||
m_mpsStatus->show();
|
||||
masterPitchMoved( m_song->m_masterPitchModel.value() );
|
||||
updateMasterPitchFloat( m_song->m_masterPitchModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterPitchMoved( int _new_val )
|
||||
void SongEditor::updateMasterPitchFloat( int _new_val )
|
||||
{
|
||||
m_mpsStatus->setText( tr( "Value: %1 semitones").arg( _new_val ) );
|
||||
|
||||
@@ -670,7 +486,7 @@ void SongEditor::masterPitchMoved( int _new_val )
|
||||
|
||||
|
||||
|
||||
void SongEditor::masterPitchReleased( void )
|
||||
void SongEditor::hideMasterPitchFloat( void )
|
||||
{
|
||||
m_mpsStatus->hide();
|
||||
}
|
||||
@@ -732,7 +548,7 @@ void SongEditor::updatePosition( const MidiTime & _t )
|
||||
}
|
||||
|
||||
if( ( m_song->isPlaying() && m_song->m_playMode == Song::Mode_PlaySong
|
||||
&& m_timeLine->autoScroll() == Timeline::AutoScrollEnabled) ||
|
||||
&& m_timeLine->autoScroll() == TimeLineWidget::AutoScrollEnabled) ||
|
||||
m_scrollBack == true )
|
||||
{
|
||||
const int w = width() - widgetWidth
|
||||
@@ -774,7 +590,7 @@ void SongEditor::updatePosition( const MidiTime & _t )
|
||||
|
||||
void SongEditor::zoomingChanged()
|
||||
{
|
||||
const QString & zfac = m_zoomingComboBox->model()->currentText();
|
||||
const QString & zfac = m_zoomingModel->currentText();
|
||||
setPixelsPerTact( zfac.left( zfac.length() - 1 ).toInt() *
|
||||
DEFAULT_PIXELS_PER_TACT / 100 );
|
||||
m_song->m_playPos[Song::Mode_PlaySong].m_timeLine->
|
||||
@@ -784,24 +600,132 @@ void SongEditor::zoomingChanged()
|
||||
|
||||
|
||||
|
||||
|
||||
void SongEditor::adjustUiAfterProjectLoad()
|
||||
{
|
||||
//if( isMaximized() )
|
||||
{
|
||||
// make sure to bring us to front as the song editor is the central
|
||||
// widget in a song and when just opening a song in order to listen to
|
||||
// it, it's very annyoing to manually bring up the song editor each time
|
||||
Engine::mainWindow()->workspace()->setActiveSubWindow(
|
||||
qobject_cast<QMdiSubWindow *>( parentWidget() ) );
|
||||
}
|
||||
scrolled( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool SongEditor::allowRubberband() const
|
||||
{
|
||||
return( m_editModeButton->isChecked() );
|
||||
return m_mode == SelectMode;
|
||||
}
|
||||
|
||||
|
||||
SongEditorWindow::SongEditorWindow(Song* song) :
|
||||
Editor(Engine::mixer()->audioDev()->supportsCapture()),
|
||||
m_editor(new SongEditor(song))
|
||||
{
|
||||
setWindowTitle( tr( "Song-Editor" ) );
|
||||
setWindowIcon( embed::getIconPixmap( "songeditor" ) );
|
||||
|
||||
setCentralWidget(m_editor);
|
||||
setAcceptDrops(true);
|
||||
m_toolBar->setAcceptDrops(true);
|
||||
connect(m_toolBar, SIGNAL(dragEntered(QDragEnterEvent*)), m_editor, SLOT(dragEnterEvent(QDragEnterEvent*)));
|
||||
connect(m_toolBar, SIGNAL(dropped(QDropEvent*)), m_editor, SLOT(dropEvent(QDropEvent*)));
|
||||
|
||||
// Set up buttons
|
||||
m_playAction->setToolTip(tr("Play song (Space)"));
|
||||
m_recordAction->setToolTip(tr("Record samples from Audio-device"));
|
||||
m_recordAccompanyAction->setToolTip(tr( "Record samples from Audio-device while playing song or BB track"));
|
||||
m_stopAction->setToolTip(tr( "Stop song (Space)" ));
|
||||
|
||||
m_addBBTrackAction = new QAction(embed::getIconPixmap("add_bb_track"),
|
||||
tr("Add beat/bassline"), this);
|
||||
|
||||
m_addSampleTrackAction = new QAction(embed::getIconPixmap("add_sample_track"),
|
||||
tr("Add sample-track"), this);
|
||||
|
||||
m_addAutomationTrackAction = new QAction(embed::getIconPixmap("add_automation"),
|
||||
tr("Add automation-track"), this);
|
||||
|
||||
connect(m_addBBTrackAction, SIGNAL(triggered()), m_editor->m_song, SLOT(addBBTrack()));
|
||||
connect(m_addSampleTrackAction, SIGNAL(triggered()), m_editor->m_song, SLOT(addSampleTrack()));
|
||||
connect(m_addAutomationTrackAction, SIGNAL(triggered()), m_editor->m_song, SLOT(addAutomationTrack()));
|
||||
|
||||
ActionGroup* editModeGroup = new ActionGroup(this);
|
||||
m_drawModeAction = editModeGroup->addAction(embed::getIconPixmap("edit_draw"), tr("Draw mode"));
|
||||
m_selectModeAction = editModeGroup->addAction(embed::getIconPixmap("edit_select"), tr("Edit mode (select and move)"));
|
||||
|
||||
m_drawModeAction->setChecked(true);
|
||||
|
||||
connect(m_drawModeAction, SIGNAL(triggered()), m_editor, SLOT(setEditModeDraw()));
|
||||
connect(m_selectModeAction, SIGNAL(triggered()), m_editor, SLOT(setEditModeSelect()));
|
||||
|
||||
|
||||
m_playAction->setWhatsThis(
|
||||
tr("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."));
|
||||
m_stopAction->setWhatsThis(
|
||||
tr("Click here, if you want to stop playing of your song. "
|
||||
"The song-position-marker will be set to the start of your song."));
|
||||
|
||||
|
||||
QLabel * zoom_lbl = new QLabel( m_toolBar );
|
||||
zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) );
|
||||
|
||||
// setup zooming-stuff
|
||||
m_zoomingComboBox = new ComboBox( m_toolBar );
|
||||
m_zoomingComboBox->setFixedSize( 80, 22 );
|
||||
m_zoomingComboBox->move( 580, 4 );
|
||||
m_zoomingComboBox->setModel(m_editor->m_zoomingModel);
|
||||
|
||||
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addAction( m_addBBTrackAction );
|
||||
m_toolBar->addAction( m_addSampleTrackAction );
|
||||
m_toolBar->addAction( m_addAutomationTrackAction );
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addAction( m_drawModeAction );
|
||||
m_toolBar->addAction( m_selectModeAction );
|
||||
m_toolBar->addSeparator();
|
||||
m_editor->m_timeLine->addToolButtons(m_toolBar);
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( zoom_lbl );
|
||||
m_toolBar->addWidget( m_zoomingComboBox );
|
||||
|
||||
connect(song, SIGNAL(projectLoaded()), this, SLOT(adjustUiAfterProjectLoad()));
|
||||
}
|
||||
|
||||
QSize SongEditorWindow::sizeHint() const
|
||||
{
|
||||
return {600, 300};
|
||||
}
|
||||
|
||||
|
||||
void SongEditorWindow::play()
|
||||
{
|
||||
if( Engine::getSong()->playMode() != Song::Mode_PlaySong )
|
||||
{
|
||||
Engine::getSong()->playSong();
|
||||
}
|
||||
else
|
||||
{
|
||||
Engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SongEditorWindow::record()
|
||||
{
|
||||
m_editor->m_song->record();
|
||||
}
|
||||
|
||||
|
||||
void SongEditorWindow::recordAccompany()
|
||||
{
|
||||
m_editor->m_song->playAndRecord();
|
||||
}
|
||||
|
||||
|
||||
void SongEditorWindow::stop()
|
||||
{
|
||||
m_editor->m_song->stop();
|
||||
gui->pianoRoll()->stopRecording();
|
||||
}
|
||||
|
||||
void SongEditorWindow::adjustUiAfterProjectLoad()
|
||||
{
|
||||
// make sure to bring us to front as the song editor is the central
|
||||
// widget in a song and when just opening a song in order to listen to
|
||||
// it, it's very annyoing to manually bring up the song editor each time
|
||||
gui->mainWindow()->workspace()->setActiveSubWindow(
|
||||
qobject_cast<QMdiSubWindow *>( parentWidget() ) );
|
||||
m_editor->scrolled(0);
|
||||
}
|
||||
@@ -105,6 +105,22 @@ QSize ComboBox::sizeHint() const
|
||||
|
||||
|
||||
|
||||
|
||||
void ComboBox::selectNext()
|
||||
{
|
||||
model()->setInitValue( model()->value() + 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ComboBox::selectPrevious()
|
||||
{
|
||||
model()->setInitValue( model()->value() - 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ComboBox::contextMenuEvent( QContextMenuEvent * event )
|
||||
{
|
||||
if( model() == NULL || event->x() <= width() - CB_ARROW_BTN_WIDTH )
|
||||
@@ -157,13 +173,13 @@ void ComboBox::mousePressEvent( QMouseEvent* event )
|
||||
}
|
||||
else if( event->button() == Qt::LeftButton )
|
||||
{
|
||||
model()->setInitValue( model()->value() + 1 );
|
||||
selectNext();
|
||||
update();
|
||||
}
|
||||
}
|
||||
else if( event->button() == Qt::RightButton )
|
||||
{
|
||||
model()->setInitValue( model()->value() - 1 );
|
||||
selectPrevious();
|
||||
update();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "Song.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GroupBox.h"
|
||||
#include "ControllerRackView.h"
|
||||
@@ -75,7 +76,7 @@ ControllerRackView::ControllerRackView( ) :
|
||||
this->setLayout( layout );
|
||||
|
||||
QMdiSubWindow * subWin =
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
|
||||
// No maximize button
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LedCheckbox.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ToolTip.h"
|
||||
@@ -62,9 +63,9 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
|
||||
connect( ctls_btn, SIGNAL( clicked() ),
|
||||
this, SLOT( editControls() ) );
|
||||
|
||||
m_controllerDlg = getController()->createDialog( Engine::mainWindow()->workspace() );
|
||||
m_controllerDlg = getController()->createDialog( gui->mainWindow()->workspace() );
|
||||
|
||||
m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = gui->mainWindow()->workspace()->addSubWindow(
|
||||
m_controllerDlg );
|
||||
|
||||
Qt::WindowFlags flags = m_subWindow->windowFlags();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "EffectControlDialog.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "Knob.h"
|
||||
#include "LedCheckbox.h"
|
||||
@@ -109,7 +110,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
|
||||
m_controlView = effect()->controls()->createView();
|
||||
if( m_controlView )
|
||||
{
|
||||
m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = gui->mainWindow()->workspace()->addSubWindow(
|
||||
m_controlView,
|
||||
Qt::SubWindow | Qt::CustomizeWindowHint |
|
||||
Qt::WindowTitleHint | Qt::WindowSystemMenuHint );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "FxMixerView.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "SendButtonIndicator.h"
|
||||
#include "gui_templates.h"
|
||||
#include "CaptionMenu.h"
|
||||
@@ -229,28 +230,28 @@ void FxLine::renameChannel()
|
||||
|
||||
void FxLine::removeChannel()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->deleteChannel( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
void FxLine::removeUnusedChannels()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->deleteUnusedChannels();
|
||||
}
|
||||
|
||||
|
||||
void FxLine::moveChannelLeft()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->moveChannelLeft( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
void FxLine::moveChannelRight()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->moveChannelRight( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
#include "MidiClient.h"
|
||||
#include "Mixer.h"
|
||||
#include "ToolTip.h"
|
||||
|
||||
#include "InstrumentTrack.h"
|
||||
#include "LedCheckbox.h"
|
||||
#include "QLabel"
|
||||
|
||||
|
||||
InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) :
|
||||
@@ -201,3 +203,24 @@ void InstrumentMidiIOView::modelChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) :
|
||||
QWidget( parent )
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout( this );
|
||||
layout->setMargin( 5 );
|
||||
m_pitchGroupBox = new GroupBox( tr ( "MASTER PITCH" ) );
|
||||
layout->addWidget( m_pitchGroupBox );
|
||||
QHBoxLayout* masterPitchLayout = new QHBoxLayout( m_pitchGroupBox );
|
||||
masterPitchLayout->setContentsMargins( 8, 18, 8, 8 );
|
||||
QLabel *tlabel = new QLabel(tr( "Enables the use of Master Pitch" ) );
|
||||
m_pitchGroupBox->setModel( &it->m_useMasterPitchModel );
|
||||
masterPitchLayout->addWidget( tlabel );
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
InstrumentMiscView::~InstrumentMiscView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "Song.h"
|
||||
@@ -458,15 +459,15 @@ float Knob::getValue( const QPoint & _p )
|
||||
{
|
||||
float value;
|
||||
|
||||
// arcane mathemagicks for calculating knob movement
|
||||
// arcane mathemagicks for calculating knob movement
|
||||
value = ( ( _p.y() + _p.y() * qMin( qAbs( _p.y() / 2.5f ), 6.0f ) ) ) / 12.0f;
|
||||
|
||||
|
||||
// if shift pressed we want slower movement
|
||||
if( Engine::mainWindow()->isShiftPressed() )
|
||||
if( gui->mainWindow()->isShiftPressed() )
|
||||
{
|
||||
value /= 4.0f;
|
||||
value = qBound( -4.0f, value, 4.0f );
|
||||
}
|
||||
}
|
||||
return value * pageSize();
|
||||
}
|
||||
|
||||
@@ -483,7 +484,7 @@ void Knob::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
CaptionMenu contextMenu( model()->displayName(), this );
|
||||
addDefaultActions( &contextMenu );
|
||||
contextMenu.addAction( QPixmap(),
|
||||
contextMenu.addAction( QPixmap(),
|
||||
model()->isScaleLogarithmic() ? tr( "Set linear" ) : tr( "Set logarithmic" ),
|
||||
this, SLOT( toggleScale() ) );
|
||||
contextMenu.addSeparator();
|
||||
@@ -561,7 +562,7 @@ void Knob::mousePressEvent( QMouseEvent * _me )
|
||||
m_buttonPressed = true;
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
Engine::mainWindow()->isShiftPressed() == true )
|
||||
gui->mainWindow()->isShiftPressed() == true )
|
||||
{
|
||||
new StringPairDrag( "float_value",
|
||||
QString::number( model()->value() ),
|
||||
@@ -681,7 +682,7 @@ void Knob::setPosition( const QPoint & _p )
|
||||
|
||||
if( model()->isScaleLogarithmic() ) // logarithmic code
|
||||
{
|
||||
const float pos = model()->minValue() < 0
|
||||
const float pos = model()->minValue() < 0
|
||||
? oldValue / qMax( qAbs( model()->maxValue() ), qAbs( model()->minValue() ) )
|
||||
: ( oldValue - model()->minValue() ) / model()->range();
|
||||
const float ratio = 0.1f + qAbs( pos ) * 15.f;
|
||||
@@ -697,11 +698,11 @@ void Knob::setPosition( const QPoint & _p )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
else // linear code
|
||||
{
|
||||
if( qAbs( value ) >= step )
|
||||
{
|
||||
{
|
||||
model()->setValue( oldValue - value );
|
||||
m_leftOver = 0.0f;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "CaptionMenu.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -126,7 +127,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event )
|
||||
if( m_mouseMoving )
|
||||
{
|
||||
int dy = event->globalY() - m_origMousePos.y();
|
||||
if( Engine::mainWindow()->isShiftPressed() )
|
||||
if( gui->mainWindow()->isShiftPressed() )
|
||||
dy = qBound( -4, dy/4, 4 );
|
||||
if( dy > 1 || dy < -1 )
|
||||
{
|
||||
|
||||
@@ -39,13 +39,14 @@
|
||||
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
|
||||
ProjectNotes::ProjectNotes() :
|
||||
QMainWindow( Engine::mainWindow()->workspace() )
|
||||
QMainWindow( gui->mainWindow()->workspace() )
|
||||
{
|
||||
m_edit = new QTextEdit( this );
|
||||
m_edit->setAutoFillBackground( true );
|
||||
@@ -70,7 +71,7 @@ ProjectNotes::ProjectNotes() :
|
||||
setWindowTitle( tr( "Project notes" ) );
|
||||
setWindowIcon( embed::getIconPixmap( "project_notes" ) );
|
||||
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->move( 700, 10 );
|
||||
parentWidget()->resize( 400, 300 );
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Engine.h"
|
||||
#include "CaptionMenu.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "Song.h"
|
||||
@@ -86,10 +87,10 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
CaptionMenu contextMenu( model()->displayName(), this );
|
||||
addDefaultActions( &contextMenu );
|
||||
contextMenu.addSeparator();
|
||||
|
||||
|
||||
float limit = 60000.0f / ( Engine::getSong()->getTempo() *
|
||||
model()->m_scale );
|
||||
|
||||
|
||||
QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon,
|
||||
m_tempoSyncDescription );
|
||||
if( limit / 8.0f <= model()->maxValue() )
|
||||
@@ -149,7 +150,7 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
contextMenu.addHelpAction();
|
||||
contextMenu.exec( QCursor::pos() );
|
||||
|
||||
|
||||
delete syncMenu;
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ void TempoSyncKnob::updateDescAndIcon()
|
||||
switch( model()->m_tempoSyncMode )
|
||||
{
|
||||
case TempoSyncKnobModel::SyncCustom:
|
||||
m_tempoSyncDescription = tr( "Custom " ) +
|
||||
m_tempoSyncDescription = tr( "Custom " ) +
|
||||
"(" +
|
||||
QString::number( model()->m_custom.numeratorModel().value() ) +
|
||||
"/" +
|
||||
@@ -291,8 +292,8 @@ void TempoSyncKnob::showCustom()
|
||||
{
|
||||
if( m_custom == NULL )
|
||||
{
|
||||
m_custom = new MeterDialog( Engine::mainWindow()->workspace() );
|
||||
Engine::mainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom = new MeterDialog( gui->mainWindow()->workspace() );
|
||||
gui->mainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom->setWindowTitle( "Meter" );
|
||||
m_custom->setModel( &model()->m_custom );
|
||||
}
|
||||
|
||||
@@ -28,13 +28,14 @@
|
||||
|
||||
#include "TextFloat.h"
|
||||
#include "gui_templates.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Engine.h"
|
||||
|
||||
|
||||
|
||||
TextFloat::TextFloat() :
|
||||
QWidget( Engine::mainWindow(), Qt::ToolTip ),
|
||||
QWidget( gui->mainWindow(), Qt::ToolTip ),
|
||||
m_title(),
|
||||
m_text(),
|
||||
m_pixmap()
|
||||
@@ -89,7 +90,7 @@ void TextFloat::setVisibilityTimeOut( int _msecs )
|
||||
TextFloat * TextFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
QWidget * _parent, int _add_y_margin )
|
||||
{
|
||||
QWidget * mw = Engine::mainWindow();
|
||||
QWidget * mw = gui->mainWindow();
|
||||
TextFloat * tf = new TextFloat;
|
||||
if( _parent != NULL )
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "TimeDisplayWidget.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Engine.h"
|
||||
#include "ToolTip.h"
|
||||
@@ -53,7 +54,7 @@ TimeDisplayWidget::TimeDisplayWidget() :
|
||||
// update labels of LCD spinboxes
|
||||
setDisplayMode( m_displayMode );
|
||||
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( updateTime() ) );
|
||||
}
|
||||
|
||||
@@ -106,12 +107,13 @@ void TimeDisplayWidget::updateTime()
|
||||
break;
|
||||
|
||||
case BarsTicks:
|
||||
m_majorLCD.setValue( s->getTacts() + 1 );
|
||||
m_minorLCD.setValue( ( s->getTicks() % s->ticksPerTact() ) /
|
||||
( s->ticksPerTact() / s->getTimeSigModel().getNumerator() ) +1 );
|
||||
;
|
||||
m_milliSecondsLCD.setValue( ( s->getTicks() % s->ticksPerTact() ) %
|
||||
( s->ticksPerTact() / s->getTimeSigModel().getNumerator() ) );
|
||||
int tick;
|
||||
tick = ( s->getMilliseconds() * s->getTempo() * (DefaultTicksPerTact / 4 ) ) / 60000 ;
|
||||
m_majorLCD.setValue( (int)(tick / s->ticksPerTact() ) + 1);
|
||||
m_minorLCD.setValue( ( tick % s->ticksPerTact() ) /
|
||||
( s->ticksPerTact() / s->getTimeSigModel().getNumerator() ) +1 );
|
||||
m_milliSecondsLCD.setValue( ( tick % s->ticksPerTact() ) %
|
||||
( s->ticksPerTact() / s->getTimeSigModel().getNumerator() ) );
|
||||
break;
|
||||
|
||||
default: break;
|
||||
|
||||
@@ -27,24 +27,12 @@
|
||||
#include "ToolTip.h"
|
||||
|
||||
|
||||
const QColor ToolButton::s_stdColor = QColor( 216, 216, 216 );
|
||||
const QColor ToolButton::s_hlColor = QColor( 240, 240, 240 );
|
||||
|
||||
|
||||
|
||||
ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip,
|
||||
QObject * _receiver, const char * _slot,
|
||||
QWidget * _parent ) :
|
||||
QToolButton( _parent ),
|
||||
m_colorStandard( s_stdColor ),
|
||||
m_colorHighlighted( s_hlColor )
|
||||
QToolButton( _parent )
|
||||
{
|
||||
setAutoFillBackground( false );
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorStandard );
|
||||
pal.setColor( QPalette::Window, m_colorStandard );
|
||||
pal.setColor( QPalette::Button, m_colorStandard );
|
||||
setPalette( pal );
|
||||
|
||||
if( _receiver != NULL && _slot != NULL )
|
||||
{
|
||||
@@ -53,9 +41,6 @@ ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip,
|
||||
ToolTip::add( this, _tooltip );
|
||||
setFixedSize( 30, 30 );
|
||||
setIcon( _pixmap );
|
||||
leaveEvent( NULL );
|
||||
connect( this, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( toggledBool( bool ) ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -68,40 +53,5 @@ ToolButton::~ToolButton()
|
||||
|
||||
|
||||
|
||||
void ToolButton::enterEvent( QEvent * )
|
||||
{
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorHighlighted );
|
||||
pal.setColor( QPalette::Window, m_colorHighlighted );
|
||||
pal.setColor( QPalette::Button, m_colorHighlighted );
|
||||
setPalette( pal );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ToolButton::leaveEvent( QEvent * )
|
||||
{
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorStandard );
|
||||
pal.setColor( QPalette::Window, m_colorStandard );
|
||||
pal.setColor( QPalette::Button, m_colorStandard );
|
||||
setPalette( pal );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ToolButton::toggledBool( bool _on )
|
||||
{
|
||||
if( _on == true )
|
||||
{
|
||||
emit( clicked() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "VisualizationWidget.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
@@ -90,7 +91,7 @@ void VisualizationWidget::setActive( bool _active )
|
||||
m_active = _active;
|
||||
if( m_active )
|
||||
{
|
||||
connect( Engine::mainWindow(),
|
||||
connect( gui->mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( Engine::mixer(),
|
||||
@@ -99,7 +100,7 @@ void VisualizationWidget::setActive( bool _active )
|
||||
}
|
||||
else
|
||||
{
|
||||
disconnect( Engine::mainWindow(),
|
||||
disconnect( gui->mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
disconnect( Engine::mixer(),
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "Mixer.h"
|
||||
#include "RenameDialog.h"
|
||||
#include "Song.h"
|
||||
@@ -58,6 +59,7 @@ BBTCO::BBTCO( Track * _track ) :
|
||||
changeLength( MidiTime( t, 0 ) );
|
||||
restoreJournallingState();
|
||||
}
|
||||
setAutoResize( false );
|
||||
}
|
||||
|
||||
|
||||
@@ -215,18 +217,23 @@ void BBTCOView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
|
||||
QColor col = m_bbTCO->m_useStyleColor
|
||||
? p.pen().brush().color()
|
||||
: m_bbTCO->colorObj();
|
||||
|
||||
QColor col;
|
||||
if( m_bbTCO->getTrack()->isMuted() || m_bbTCO->isMuted() )
|
||||
{
|
||||
col = QColor( 160, 160, 160 );
|
||||
}
|
||||
else if ( m_bbTCO->m_useStyleColor )
|
||||
{
|
||||
col = p.pen().brush().color();
|
||||
}
|
||||
else
|
||||
{
|
||||
col = m_bbTCO->colorObj();
|
||||
}
|
||||
|
||||
if( isSelected() == true )
|
||||
{
|
||||
col = QColor( qMax( col.red() - 128, 0 ),
|
||||
qMax( col.green() - 128, 0 ), 255 );
|
||||
col.setRgb( qMax( col.red() - 128, 0 ), qMax( col.green() - 128, 0 ), 255 );
|
||||
}
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
@@ -275,7 +282,7 @@ void BBTCOView::openInBBEditor()
|
||||
{
|
||||
Engine::getBBTrackContainer()->setCurrentBB( m_bbTCO->bbTrackIndex() );
|
||||
|
||||
Engine::mainWindow()->toggleBBEditorWin( true );
|
||||
gui->mainWindow()->toggleBBEditorWin( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +317,7 @@ void BBTCOView::changeColor()
|
||||
if( isSelected() )
|
||||
{
|
||||
QVector<selectableObject *> selected =
|
||||
Engine::songEditor()->selectedObjects();
|
||||
gui->songEditor()->m_editor->selectedObjects();
|
||||
for( QVector<selectableObject *>::iterator it =
|
||||
selected.begin();
|
||||
it != selected.end(); ++it )
|
||||
@@ -599,7 +606,7 @@ BBTrackView::BBTrackView( BBTrack * _bbt, TrackContainerView* tcv ) :
|
||||
|
||||
BBTrackView::~BBTrackView()
|
||||
{
|
||||
Engine::getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
gui->getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
}
|
||||
|
||||
|
||||
@@ -607,7 +614,7 @@ BBTrackView::~BBTrackView()
|
||||
|
||||
bool BBTrackView::close()
|
||||
{
|
||||
Engine::getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
gui->getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
return TrackView::close();
|
||||
}
|
||||
|
||||
@@ -617,7 +624,7 @@ bool BBTrackView::close()
|
||||
void BBTrackView::clickedTrackLabel()
|
||||
{
|
||||
Engine::getBBTrackContainer()->setCurrentBB( m_bbTrack->index() );
|
||||
Engine::getBBEditor()->show();
|
||||
gui->getBBEditor()->show();
|
||||
/* foreach( bbTrackView * tv,
|
||||
trackContainerView()->findChildren<bbTrackView *>() )
|
||||
{
|
||||
|
||||
10
src/tracks/CMakeLists.txt
Normal file
10
src/tracks/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
set(LMMS_SRCS
|
||||
${LMMS_SRCS}
|
||||
tracks/AutomationTrack.cpp
|
||||
tracks/BBTrack.cpp
|
||||
tracks/InstrumentTrack.cpp
|
||||
tracks/Pattern.cpp
|
||||
tracks/SampleTrack.cpp
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "FileBrowser.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "InstrumentSoundShapingView.h"
|
||||
#include "FadeButton.h"
|
||||
@@ -109,6 +110,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
|
||||
m_pitchModel( 0, MinPitchDefault, MaxPitchDefault, 1, this, tr( "Pitch" ) ),
|
||||
m_pitchRangeModel( 1, 1, 24, this, tr( "Pitch range" ) ),
|
||||
m_effectChannelModel( 0, 0, 0, this, tr( "FX channel" ) ),
|
||||
m_useMasterPitchModel( true, this, tr( "Master Pitch") ),
|
||||
m_instrument( NULL ),
|
||||
m_soundShaping( this ),
|
||||
m_arpeggio( this ),
|
||||
@@ -139,7 +141,9 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
|
||||
|
||||
int InstrumentTrack::baseNote() const
|
||||
{
|
||||
return m_baseNoteModel.value() - Engine::getSong()->masterPitch();
|
||||
int mp = m_useMasterPitchModel.value() ? Engine::getSong()->masterPitch() : 0;
|
||||
|
||||
return m_baseNoteModel.value() - mp;
|
||||
}
|
||||
|
||||
|
||||
@@ -550,6 +554,7 @@ void InstrumentTrack::updatePitchRange()
|
||||
|
||||
int InstrumentTrack::masterKey( int _midi_key ) const
|
||||
{
|
||||
|
||||
int key = baseNote();
|
||||
return tLimit<int>( _midi_key - ( key - DefaultKey ), 0, NumKeys );
|
||||
}
|
||||
@@ -700,6 +705,7 @@ void InstrumentTrack::saveTrackSpecificSettings( QDomDocument& doc, QDomElement
|
||||
|
||||
m_effectChannelModel.saveSettings( doc, thisElement, "fxch" );
|
||||
m_baseNoteModel.saveSettings( doc, thisElement, "basenote" );
|
||||
m_useMasterPitchModel.saveSettings( doc, thisElement, "usemasterpitch");
|
||||
|
||||
if( m_instrument != NULL )
|
||||
{
|
||||
@@ -731,6 +737,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
|
||||
m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1 );
|
||||
m_effectChannelModel.loadSettings( thisElement, "fxch" );
|
||||
m_baseNoteModel.loadSettings( thisElement, "basenote" );
|
||||
m_useMasterPitchModel.loadSettings( thisElement, "usemasterpitch");
|
||||
|
||||
// clear effect-chain just in case we load an old preset without FX-data
|
||||
m_audioPort.effects()->clear();
|
||||
@@ -941,7 +948,7 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
|
||||
{
|
||||
InstrumentTrackWindow * w = NULL;
|
||||
foreach( QMdiSubWindow * sw,
|
||||
Engine::mainWindow()->workspace()->subWindowList(
|
||||
gui->mainWindow()->workspace()->subWindowList(
|
||||
QMdiArea::ActivationHistoryOrder ) )
|
||||
{
|
||||
if( sw->isVisible() && sw->widget()->inherits( "InstrumentTrackWindow" ) )
|
||||
@@ -1135,10 +1142,10 @@ class fxLineLcdSpinBox : public LcdSpinBox
|
||||
protected:
|
||||
virtual void mouseDoubleClickEvent ( QMouseEvent * _me )
|
||||
{
|
||||
Engine::fxMixerView()->setCurrentFxLine( model()->value() );
|
||||
gui->fxMixerView()->setCurrentFxLine( model()->value() );
|
||||
|
||||
Engine::fxMixerView()->show();// show fxMixer window
|
||||
Engine::fxMixerView()->setFocus();// set focus to fxMixer window
|
||||
gui->fxMixerView()->show();// show fxMixer window
|
||||
gui->fxMixerView()->setFocus();// set focus to fxMixer window
|
||||
//engine::getFxMixerView()->raise();
|
||||
}
|
||||
};
|
||||
@@ -1211,6 +1218,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
basicControlsLayout->addWidget( m_pitchRangeSpinBox );
|
||||
basicControlsLayout->addStretch();
|
||||
|
||||
|
||||
// setup spinbox for selecting FX-channel
|
||||
m_effectChannelNumber = new fxLineLcdSpinBox( 2, NULL, tr( "FX channel" ) );
|
||||
m_effectChannelNumber->setLabel( tr( "FX" ) );
|
||||
@@ -1259,10 +1267,15 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
// FX tab
|
||||
m_effectView = new EffectRackView( m_track->m_audioPort.effects(), m_tabWidget );
|
||||
|
||||
// MISC tab
|
||||
m_miscView = new InstrumentMiscView( m_track, m_tabWidget );
|
||||
|
||||
|
||||
m_tabWidget->addTab( m_ssView, tr( "ENV/LFO" ), 1 );
|
||||
m_tabWidget->addTab( instrumentFunctions, tr( "FUNC" ), 2 );
|
||||
m_tabWidget->addTab( m_effectView, tr( "FX" ), 3 );
|
||||
m_tabWidget->addTab( m_midiView, tr( "MIDI" ), 4 );
|
||||
m_tabWidget->addTab( m_miscView, tr( "MISC" ), 5 );
|
||||
|
||||
// setup piano-widget
|
||||
m_pianoView = new PianoView( this );
|
||||
@@ -1280,7 +1293,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
setFixedWidth( INSTRUMENT_WIDTH );
|
||||
resize( sizeHint() );
|
||||
|
||||
QMdiSubWindow * subWin = Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
QMdiSubWindow * subWin = gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
@@ -1306,7 +1319,7 @@ InstrumentTrackWindow::~InstrumentTrackWindow()
|
||||
|
||||
delete m_instrumentView;
|
||||
|
||||
if( Engine::mainWindow()->workspace() )
|
||||
if( gui->mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
parentWidget()->deleteLater();
|
||||
@@ -1390,6 +1403,8 @@ void InstrumentTrackWindow::saveSettingsBtnClicked()
|
||||
sfd.setAcceptMode( FileDialog::AcceptSave );
|
||||
sfd.setDirectory( presetRoot + m_track->instrumentName() );
|
||||
sfd.setFileMode( FileDialog::AnyFile );
|
||||
QString fname = m_track->name();
|
||||
sfd.selectFile(fname.remove(QRegExp("[^a-zA-Z0-9\\d\\s]")).toLower().replace( " ", "_" ) );
|
||||
|
||||
if( sfd.exec() == QDialog::Accepted &&
|
||||
!sfd.selectedFiles().isEmpty() &&
|
||||
@@ -1472,7 +1487,7 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
if( Engine::mainWindow()->workspace() )
|
||||
if( gui->mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "TrackContainer.h"
|
||||
#include "RenameDialog.h"
|
||||
@@ -66,6 +66,7 @@ Pattern::Pattern( InstrumentTrack * _instrument_track ) :
|
||||
{
|
||||
setName( _instrument_track->name() );
|
||||
init();
|
||||
setAutoResize( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +84,18 @@ Pattern::Pattern( const Pattern& other ) :
|
||||
}
|
||||
|
||||
init();
|
||||
switch( getTrack()->trackContainer()->type() )
|
||||
{
|
||||
case TrackContainer::BBContainer:
|
||||
setAutoResize( true );
|
||||
break;
|
||||
|
||||
case TrackContainer::SongContainer:
|
||||
// move down
|
||||
default:
|
||||
setAutoResize( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,9 +183,9 @@ MidiTime Pattern::beatPatternLength() const
|
||||
Note * Pattern::addNote( const Note & _new_note, const bool _quant_pos )
|
||||
{
|
||||
Note * new_note = new Note( _new_note );
|
||||
if( _quant_pos && Engine::pianoRoll() )
|
||||
if( _quant_pos && gui->pianoRoll() )
|
||||
{
|
||||
new_note->quantizePos( Engine::pianoRoll()->quantization() );
|
||||
new_note->quantizePos( gui->pianoRoll()->quantization() );
|
||||
}
|
||||
|
||||
instrumentTrack()->lock();
|
||||
@@ -421,6 +434,32 @@ void Pattern::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::previousPattern() const
|
||||
{
|
||||
return adjacentPatternByOffset(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::nextPattern() const
|
||||
{
|
||||
return adjacentPatternByOffset(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Pattern * Pattern::adjacentPatternByOffset(int offset) const
|
||||
{
|
||||
QVector<TrackContentObject *> tcos = m_instrumentTrack->getTCOs();
|
||||
int tcoNum = m_instrumentTrack->getTCONum(this);
|
||||
return dynamic_cast<Pattern*>(tcos.value(tcoNum + offset, NULL));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Pattern::clear()
|
||||
{
|
||||
addJournalCheckPoint();
|
||||
@@ -486,12 +525,15 @@ void Pattern::ensureBeatNotes()
|
||||
for( int i = 0; i < m_steps; ++i )
|
||||
{
|
||||
bool found = false;
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); ++it )
|
||||
NoteVector::Iterator it;
|
||||
|
||||
for( it = m_notes.begin(); it != m_notes.end(); ++it )
|
||||
{
|
||||
Note *note = *it;
|
||||
// if a note in this position is the one we want
|
||||
if( ( *it )->pos() ==
|
||||
if( note->pos() ==
|
||||
( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
&& ( *it )->length() <= 0 )
|
||||
&& note->length() <= 0 )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -511,10 +553,12 @@ void Pattern::ensureBeatNotes()
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); )
|
||||
{
|
||||
bool needed = false;
|
||||
Note *note = *it;
|
||||
|
||||
for( int i = 0; i < m_steps; ++i )
|
||||
{
|
||||
if( ( *it )->pos() == ( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
|| ( *it )->length() != 0 )
|
||||
if( note->pos() == ( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
|| note->length() != 0 )
|
||||
{
|
||||
needed = true;
|
||||
break;
|
||||
@@ -522,10 +566,12 @@ void Pattern::ensureBeatNotes()
|
||||
}
|
||||
if( needed == false )
|
||||
{
|
||||
delete *it;
|
||||
delete note;
|
||||
it = m_notes.erase( it );
|
||||
}
|
||||
else ++it;
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,9 +585,9 @@ void Pattern::updateBBTrack()
|
||||
Engine::getBBTrackContainer()->updateBBTrack( this );
|
||||
}
|
||||
|
||||
if( Engine::pianoRoll() && Engine::pianoRoll()->currentPattern() == this )
|
||||
if( gui && gui->pianoRoll() && gui->pianoRoll()->currentPattern() == this )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +653,7 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) :
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
connect( Engine::pianoRoll(), SIGNAL( currentPatternChanged() ),
|
||||
connect( gui->pianoRoll(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
if( s_stepBtnOn == NULL )
|
||||
@@ -635,7 +681,6 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) :
|
||||
}
|
||||
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
setAutoResizeEnabled( false );
|
||||
|
||||
ToolTip::add( this,
|
||||
tr( "double-click to open this pattern in piano-roll\n"
|
||||
@@ -668,9 +713,10 @@ void PatternView::update()
|
||||
|
||||
void PatternView::openInPianoRoll()
|
||||
{
|
||||
Engine::pianoRoll()->setCurrentPattern( m_pat );
|
||||
Engine::pianoRoll()->parentWidget()->show();
|
||||
Engine::pianoRoll()->setFocus();
|
||||
gui->pianoRoll()->setCurrentPattern( m_pat );
|
||||
gui->pianoRoll()->parentWidget()->show();
|
||||
gui->pianoRoll()->show();
|
||||
gui->pianoRoll()->setFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -801,9 +847,9 @@ void PatternView::mousePressEvent( QMouseEvent * _me )
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -862,9 +908,9 @@ void PatternView::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
_we->accept();
|
||||
@@ -904,13 +950,20 @@ void PatternView::paintEvent( QPaintEvent * )
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
|
||||
QColor c;
|
||||
|
||||
if(( m_pat->m_patternType != Pattern::BeatPattern ) &&
|
||||
!( m_pat->getTrack()->isMuted() || m_pat->isMuted() ))
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: styleColor;
|
||||
!( m_pat->getTrack()->isMuted() || m_pat->isMuted() ))
|
||||
{
|
||||
c = styleColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = QColor( 80, 80, 80 );
|
||||
}
|
||||
|
||||
if( isSelected() == true )
|
||||
{
|
||||
c.setRgb( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
|
||||
}
|
||||
|
||||
if( m_pat->m_patternType != Pattern::BeatPattern )
|
||||
{
|
||||
@@ -924,7 +977,7 @@ void PatternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setBrush( lingrad );
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
@@ -933,7 +986,7 @@ void PatternView::paintEvent( QPaintEvent * )
|
||||
p.setBrush( QBrush() );
|
||||
if( m_pat->m_patternType != Pattern::BeatPattern )
|
||||
{
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "StringPairDrag.h"
|
||||
#include "Knob.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "EffectRackView.h"
|
||||
#include "TrackLabelButton.h"
|
||||
#include "ConfigManager.h"
|
||||
@@ -62,6 +63,18 @@ SampleTCO::SampleTCO( Track * _track ) :
|
||||
// change length of this TCO
|
||||
connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
|
||||
this, SLOT( updateLength( bpm_t ) ) );
|
||||
switch( getTrack()->trackContainer()->type() )
|
||||
{
|
||||
case TrackContainer::BBContainer:
|
||||
setAutoResize( true );
|
||||
break;
|
||||
|
||||
case TrackContainer::SongContainer:
|
||||
// move down
|
||||
default:
|
||||
setAutoResize( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -340,9 +353,18 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
QColor c;
|
||||
if( !( m_tco->getTrack()->isMuted() || m_tco->isMuted() ) )
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: styleColor;
|
||||
else c = QColor( 80, 80, 80 );
|
||||
{
|
||||
c = styleColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = QColor( 80, 80, 80 );
|
||||
}
|
||||
|
||||
if( isSelected() == true )
|
||||
{
|
||||
c.setRgb( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
|
||||
}
|
||||
|
||||
QLinearGradient grad( 0, 0, 0, height() );
|
||||
|
||||
@@ -567,7 +589,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) :
|
||||
m_effectRack = new EffectRackView( _t->audioPort()->effects() );
|
||||
m_effectRack->setFixedSize( 240, 242 );
|
||||
|
||||
m_effWindow = Engine::mainWindow()->workspace()->addSubWindow( m_effectRack );
|
||||
m_effWindow = gui->mainWindow()->workspace()->addSubWindow( m_effectRack );
|
||||
m_effWindow->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||
m_effWindow->setWindowTitle( _t->name() );
|
||||
|
||||
Reference in New Issue
Block a user