singerbot proxy, fixed recently opened files, style sheet support
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@574 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -67,8 +67,8 @@ audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
return;
|
||||
}
|
||||
|
||||
snd_pcm_hw_params_alloca( &m_hwParams );
|
||||
snd_pcm_sw_params_alloca( &m_swParams );
|
||||
snd_pcm_hw_params_malloc( &m_hwParams );
|
||||
snd_pcm_sw_params_malloc( &m_swParams );
|
||||
|
||||
if( ( err = setHWParams( _sample_rate, channels(),
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED ) ) < 0 )
|
||||
@@ -97,8 +97,8 @@ audioALSA::~audioALSA()
|
||||
{
|
||||
snd_pcm_close( m_handle );
|
||||
}
|
||||
// the following code doesn't work and leads to a crash...
|
||||
/* if( m_hwParams != NULL )
|
||||
|
||||
if( m_hwParams != NULL )
|
||||
{
|
||||
snd_pcm_hw_params_free( m_hwParams );
|
||||
}
|
||||
@@ -106,7 +106,7 @@ audioALSA::~audioALSA()
|
||||
if( m_swParams != NULL )
|
||||
{
|
||||
snd_pcm_sw_params_free( m_swParams );
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -80,11 +80,13 @@ inline Sint32 audioFileOgg::writePage( void )
|
||||
bool audioFileOgg::startEncoding( void )
|
||||
{
|
||||
vorbis_comment vc;
|
||||
char * comments = "Cool=This song has been made using Linux "
|
||||
const char * comments = "Cool=This song has been made using Linux "
|
||||
"MultiMedia Studio";
|
||||
Sint32 comment_length = strlen( comments );
|
||||
char * user_comments = new char[comment_length + 1];
|
||||
strcpy( user_comments, comments );
|
||||
|
||||
vc.user_comments = &comments;
|
||||
vc.user_comments = &user_comments;
|
||||
vc.comment_lengths = &comment_length;
|
||||
vc.comments = 1;
|
||||
vc.vendor = NULL;
|
||||
|
||||
@@ -26,15 +26,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "automation_editor.h"
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QScrollBar>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
@@ -44,7 +48,6 @@
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "automation_editor.h"
|
||||
#include "song_editor.h"
|
||||
#include "main_window.h"
|
||||
#include "embed.h"
|
||||
|
||||
@@ -283,7 +283,7 @@ void automationPattern::processMidiTime( const midiTime & _time )
|
||||
}
|
||||
|
||||
|
||||
#undef value
|
||||
|
||||
|
||||
#include "automation_pattern.moc"
|
||||
|
||||
|
||||
@@ -820,15 +820,15 @@ bool configManager::loadConfigFile( void )
|
||||
( 0, tr( "Version mismatches" ),
|
||||
tr( "Accordingly to the information in "
|
||||
"your LMMS-configuration-file "
|
||||
"you seem\nto have run a "
|
||||
"you seem to have run a "
|
||||
"different (probably older) "
|
||||
"version of LMMS before.\n"
|
||||
"It is recommended to run the "
|
||||
"setup-wizard again to ensure "
|
||||
"that\nthe latest samples, "
|
||||
"that the latest samples, "
|
||||
"presets, demo-projects etc. "
|
||||
"are installed in your\n"
|
||||
"LMMS-working-directory. "
|
||||
"are installed in your "
|
||||
"LMMS-working-directory.\n"
|
||||
"Run the setup-wizard now?" ),
|
||||
QMessageBox::Yes, QMessageBox::No )
|
||||
== QMessageBox::Yes )
|
||||
@@ -840,6 +840,11 @@ bool configManager::loadConfigFile( void )
|
||||
}
|
||||
}
|
||||
|
||||
QDir::setSearchPaths( "resources", QStringList() << artworkDir()
|
||||
<< defaultArtworkDir() );
|
||||
|
||||
loadStyleSheet();
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -911,6 +916,16 @@ void configManager::saveConfigFile( void )
|
||||
|
||||
|
||||
|
||||
|
||||
void configManager::loadStyleSheet( void )
|
||||
{
|
||||
QFile file( "resources:style.css" );
|
||||
file.open( QIODevice::ReadOnly );
|
||||
qApp->setStyleSheet( file.readAll() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void configManager::processFilesRecursively( const QString & _src_dir,
|
||||
const QString & _dst_dir,
|
||||
@@ -941,7 +956,5 @@ void configManager::processFilesRecursively( const QString & _src_dir,
|
||||
|
||||
|
||||
#include "config_mgr.moc"
|
||||
#undef absolutePath
|
||||
#undef addButton
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QPushButton>
|
||||
#include "file_browser.h"
|
||||
|
||||
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QCursor>
|
||||
class QColorGroup;
|
||||
#include <Qt3Support/Q3Header>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#include "file_browser.h"
|
||||
#include "bb_editor.h"
|
||||
#include "config_mgr.h"
|
||||
#include "debug.h"
|
||||
@@ -57,7 +57,6 @@ fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
|
||||
const QString & _title, const QPixmap & _pm,
|
||||
QWidget * _parent ) :
|
||||
sideBarWidget( _title, _pm, _parent ),
|
||||
m_contextMenuItem( NULL ),
|
||||
m_directories( _directories ),
|
||||
m_filter( _filter )
|
||||
{
|
||||
@@ -65,12 +64,6 @@ fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
|
||||
m_l = new listView( contentParent() );
|
||||
addContentWidget( m_l );
|
||||
|
||||
connect( m_l, SIGNAL( contextMenuRequested( Q3ListViewItem *,
|
||||
const QPoint &, int ) ),
|
||||
this, SLOT( contextMenuRequest( Q3ListViewItem *,
|
||||
const QPoint &, int ) ) );
|
||||
|
||||
|
||||
QPushButton * reload_btn = new QPushButton( embed::getIconPixmap(
|
||||
"reload" ), tr( "Reload (F5)" ), contentParent() );
|
||||
addContentWidget( reload_btn );
|
||||
@@ -98,36 +91,6 @@ void fileBrowser::reloadTree( void )
|
||||
{
|
||||
addItems( *it );
|
||||
}
|
||||
|
||||
Q3ListViewItem * item = m_l->firstChild();
|
||||
bool resort = FALSE;
|
||||
|
||||
// sort merged directories
|
||||
while( item != NULL )
|
||||
{
|
||||
directory * d = dynamic_cast<directory *>( item );
|
||||
if( d == NULL )
|
||||
{
|
||||
resort = TRUE;
|
||||
}
|
||||
else if( resort == TRUE )
|
||||
{
|
||||
Q3ListViewItem * i2 = m_l->firstChild();
|
||||
d->moveItem( i2 );
|
||||
i2->moveItem( d );
|
||||
directory * d2 = NULL;
|
||||
while( ( d2 = dynamic_cast<directory *>( i2 ) ) !=
|
||||
NULL )
|
||||
{
|
||||
if( d->text( 0 ) > d2->text( 0 ) )
|
||||
{
|
||||
d->moveItem( d2 );
|
||||
}
|
||||
i2 = i2->nextSibling();
|
||||
}
|
||||
}
|
||||
item = item->nextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,15 +99,48 @@ void fileBrowser::reloadTree( void )
|
||||
void fileBrowser::addItems( const QString & _path )
|
||||
{
|
||||
QDir cdir( _path );
|
||||
QStringList files = cdir.entryList( QDir::Files, QDir::Name );
|
||||
|
||||
// TODO: after dropping qt3-support we can use QStringList's iterator
|
||||
// which makes it possible to travel through the list in reverse
|
||||
// direction
|
||||
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
QStringList files = cdir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( QStringList::const_iterator it = files.constBegin();
|
||||
it != files.constEnd(); ++it )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.' &&
|
||||
isDirWithContent( _path + QDir::separator() + cur_file,
|
||||
m_filter ) )
|
||||
{
|
||||
bool orphan = TRUE;
|
||||
for( int i = 0; i < m_l->topLevelItemCount(); ++i )
|
||||
{
|
||||
directory * d = dynamic_cast<directory *>(
|
||||
m_l->topLevelItem( i ) );
|
||||
if( d == NULL || cur_file < d->text( 0 ) )
|
||||
{
|
||||
m_l->insertTopLevelItem( i,
|
||||
new directory( cur_file, _path,
|
||||
m_filter ) );
|
||||
orphan = FALSE;
|
||||
break;
|
||||
}
|
||||
else if( cur_file == d->text( 0 ) )
|
||||
{
|
||||
d->addDirectory( _path );
|
||||
orphan = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( orphan )
|
||||
{
|
||||
m_l->addTopLevelItem( new directory( cur_file,
|
||||
_path, m_filter ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
files = cdir.entryList( QDir::Files, QDir::Name );
|
||||
for( QStringList::const_iterator it = files.constBegin();
|
||||
it != files.constEnd(); ++it )
|
||||
{
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.'
|
||||
#warning TODO: add match here
|
||||
#ifdef QT4
|
||||
@@ -154,33 +150,17 @@ void fileBrowser::addItems( const QString & _path )
|
||||
#endif
|
||||
)
|
||||
{
|
||||
// TODO: don't insert instead of removing, order changed
|
||||
// remove existing file-items
|
||||
delete m_l->findItem( cur_file, 0 );
|
||||
QList<QTreeWidgetItem *> existing = m_l->findItems(
|
||||
cur_file, Qt::MatchFixedString );
|
||||
if( !existing.empty() )
|
||||
{
|
||||
delete existing.front();
|
||||
}
|
||||
(void) new fileItem( m_l, cur_file, _path );
|
||||
}
|
||||
}
|
||||
|
||||
files = cdir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.' &&
|
||||
isDirWithContent( _path + QDir::separator() + cur_file,
|
||||
m_filter ) )
|
||||
{
|
||||
Q3ListViewItem * item = m_l->findItem( cur_file, 0 );
|
||||
if( item == NULL )
|
||||
{
|
||||
(void) new directory( m_l, cur_file, _path,
|
||||
m_filter );
|
||||
}
|
||||
else if( dynamic_cast<directory *>( item ) != NULL )
|
||||
{
|
||||
dynamic_cast<directory *>( item )->
|
||||
addDirectory( _path );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,11 +176,7 @@ bool fileBrowser::isDirWithContent( const QString & _path,
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.'
|
||||
#warning TODO: add match here
|
||||
#ifdef QT4
|
||||
// TBD
|
||||
#else
|
||||
// && QDir::match( _filter, cur_file.lower() )
|
||||
#endif
|
||||
&& QDir::match( _filter, cur_file.toLower() )
|
||||
)
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -240,169 +216,30 @@ void fileBrowser::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
|
||||
|
||||
void fileBrowser::contextMenuRequest( Q3ListViewItem * i, const QPoint &, int )
|
||||
{
|
||||
fileItem * f = dynamic_cast<fileItem *>( i );
|
||||
if( f != NULL && ( f->type() == fileItem::SAMPLE_FILE ||
|
||||
f->type() == fileItem::PRESET_FILE ) )
|
||||
{
|
||||
m_contextMenuItem = f;
|
||||
QMenu * contextMenu = new QMenu( this );
|
||||
contextMenu->addAction( tr( "Send to active instrument-track" ),
|
||||
this,
|
||||
SLOT( sendToActiveInstrumentTrack() ) );
|
||||
contextMenu->addAction( tr( "Open in new instrument-track/"
|
||||
"Song-Editor" ),
|
||||
this,
|
||||
SLOT( openInNewInstrumentTrackSE() ) );
|
||||
contextMenu->addAction( tr( "Open in new instrument-track/"
|
||||
"B+B Editor" ),
|
||||
this,
|
||||
SLOT( openInNewInstrumentTrackBBE() ) );
|
||||
contextMenu->exec( QCursor::pos() );
|
||||
m_contextMenuItem = NULL;
|
||||
delete contextMenu;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fileBrowser::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
if( engine::getMainWindow()->workspace() == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get all windows opened in the workspace
|
||||
QWidgetList pl = engine::getMainWindow()->workspace()->windowList(
|
||||
QWorkspace::StackingOrder );
|
||||
QListIterator<QWidget *> w( pl );
|
||||
w.toBack();
|
||||
// now we travel through the window-list until we find an
|
||||
// instrument-track
|
||||
while( w.hasPrevious() )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
|
||||
w.previous() );
|
||||
if( ct != NULL && ct->isHidden() == FALSE )
|
||||
{
|
||||
// ok, it's an instrument-track, so we can apply the
|
||||
// sample or the preset
|
||||
engine::getMixer()->lock();
|
||||
if( m_contextMenuItem->type() == fileItem::SAMPLE_FILE )
|
||||
{
|
||||
instrument * afp = ct->loadInstrument(
|
||||
engine::sampleExtensions()
|
||||
[m_contextMenuItem
|
||||
->extension()] );
|
||||
if( afp != NULL )
|
||||
{
|
||||
afp->setParameter( "samplefile",
|
||||
m_contextMenuItem->fullName() );
|
||||
}
|
||||
}
|
||||
else if( m_contextMenuItem->type() ==
|
||||
fileItem::PRESET_FILE )
|
||||
{
|
||||
multimediaProject mmp(
|
||||
m_contextMenuItem->fullName() );
|
||||
ct->loadTrackSpecificSettings( mmp.content().
|
||||
firstChild().
|
||||
toElement() );
|
||||
}
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
engine::getMixer()->unlock();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fileBrowser::openInNewInstrumentTrack( trackContainer * _tc )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
if( m_contextMenuItem->type() == fileItem::SAMPLE_FILE )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
|
||||
track::create( track::INSTRUMENT_TRACK, _tc ) );
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( ct != NULL );
|
||||
#endif
|
||||
instrument * afp = ct->loadInstrument(
|
||||
engine::sampleExtensions()
|
||||
[m_contextMenuItem
|
||||
->extension()] );
|
||||
if( afp != NULL )
|
||||
{
|
||||
afp->setParameter( "samplefile",
|
||||
m_contextMenuItem->fullName() );
|
||||
}
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
}
|
||||
else if( m_contextMenuItem->type() == fileItem::PRESET_FILE )
|
||||
{
|
||||
multimediaProject mmp( m_contextMenuItem->fullName() );
|
||||
track * t = track::create( track::INSTRUMENT_TRACK, _tc );
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>( t );
|
||||
if( ct != NULL )
|
||||
{
|
||||
ct->loadTrackSpecificSettings( mmp.content().
|
||||
firstChild().
|
||||
toElement() );
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
}
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fileBrowser::openInNewInstrumentTrackSE( void )
|
||||
{
|
||||
openInNewInstrumentTrack( engine::getSongEditor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fileBrowser::openInNewInstrumentTrackBBE( void )
|
||||
{
|
||||
openInNewInstrumentTrack( engine::getBBEditor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
listView::listView( QWidget * _parent ) :
|
||||
Q3ListView( _parent ),
|
||||
QTreeWidget( _parent ),
|
||||
m_mousePressed( FALSE ),
|
||||
m_pressPos(),
|
||||
m_previewPlayHandle( NULL ),
|
||||
m_pphMutex()
|
||||
m_pphMutex(),
|
||||
m_contextMenuItem( NULL )
|
||||
{
|
||||
addColumn( tr( "Files" ) );
|
||||
setTreeStepSize( 12 );
|
||||
setSorting( -1 );
|
||||
setShowToolTips( TRUE );
|
||||
setColumnCount( 1 );
|
||||
setHeaderLabel( tr( "Files" ) );
|
||||
setSortingEnabled( FALSE );
|
||||
|
||||
setFont( pointSizeF( font(), 7.5f ) );
|
||||
|
||||
connect( this, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ),
|
||||
SLOT( activateListItem( QTreeWidgetItem *, int ) ) );
|
||||
connect( this, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ),
|
||||
SLOT( updateDirectory( QTreeWidgetItem * ) ) );
|
||||
connect( this, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
|
||||
SLOT( updateDirectory( QTreeWidgetItem * ) ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -415,11 +252,9 @@ listView::~listView()
|
||||
|
||||
|
||||
|
||||
void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
|
||||
void listView::activateListItem( QTreeWidgetItem * _item, int _column )
|
||||
{
|
||||
Q3ListView::contentsMouseDoubleClickEvent( _me );
|
||||
fileItem * f = dynamic_cast<fileItem *>( itemAt(
|
||||
contentsToViewport( _me->pos() ) ) );
|
||||
fileItem * f = dynamic_cast<fileItem *>( _item );
|
||||
if( f == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -474,27 +309,176 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
void listView::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
Q3ListView::contentsMousePressEvent( _me );
|
||||
if( engine::getMainWindow()->workspace() == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get all windows opened in the workspace
|
||||
QWidgetList pl = engine::getMainWindow()->workspace()->windowList(
|
||||
QWorkspace::StackingOrder );
|
||||
QListIterator<QWidget *> w( pl );
|
||||
w.toBack();
|
||||
// now we travel through the window-list until we find an
|
||||
// instrument-track
|
||||
while( w.hasPrevious() )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
|
||||
w.previous() );
|
||||
if( ct != NULL && ct->isHidden() == FALSE )
|
||||
{
|
||||
// ok, it's an instrument-track, so we can apply the
|
||||
// sample or the preset
|
||||
engine::getMixer()->lock();
|
||||
if( m_contextMenuItem->type() == fileItem::SAMPLE_FILE )
|
||||
{
|
||||
instrument * afp = ct->loadInstrument(
|
||||
engine::sampleExtensions()
|
||||
[m_contextMenuItem
|
||||
->extension()] );
|
||||
if( afp != NULL )
|
||||
{
|
||||
afp->setParameter( "samplefile",
|
||||
m_contextMenuItem->fullName() );
|
||||
}
|
||||
}
|
||||
else if( m_contextMenuItem->type() ==
|
||||
fileItem::PRESET_FILE )
|
||||
{
|
||||
multimediaProject mmp(
|
||||
m_contextMenuItem->fullName() );
|
||||
ct->loadTrackSpecificSettings( mmp.content().
|
||||
firstChild().
|
||||
toElement() );
|
||||
}
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
engine::getMixer()->unlock();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::openInNewInstrumentTrack( trackContainer * _tc )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
if( m_contextMenuItem->type() == fileItem::SAMPLE_FILE )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
|
||||
track::create( track::INSTRUMENT_TRACK, _tc ) );
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( ct != NULL );
|
||||
#endif
|
||||
instrument * afp = ct->loadInstrument(
|
||||
engine::sampleExtensions()
|
||||
[m_contextMenuItem
|
||||
->extension()] );
|
||||
if( afp != NULL )
|
||||
{
|
||||
afp->setParameter( "samplefile",
|
||||
m_contextMenuItem->fullName() );
|
||||
}
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
}
|
||||
else if( m_contextMenuItem->type() == fileItem::PRESET_FILE )
|
||||
{
|
||||
multimediaProject mmp( m_contextMenuItem->fullName() );
|
||||
track * t = track::create( track::INSTRUMENT_TRACK, _tc );
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>( t );
|
||||
if( ct != NULL )
|
||||
{
|
||||
ct->loadTrackSpecificSettings( mmp.content().
|
||||
firstChild().
|
||||
toElement() );
|
||||
ct->toggledInstrumentTrackButton( TRUE );
|
||||
}
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::openInNewInstrumentTrackBBE( void )
|
||||
{
|
||||
openInNewInstrumentTrack( engine::getBBEditor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::openInNewInstrumentTrackSE( void )
|
||||
{
|
||||
openInNewInstrumentTrack( engine::getSongEditor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::updateDirectory( QTreeWidgetItem * _item )
|
||||
{
|
||||
directory * dir = dynamic_cast<directory *>( _item );
|
||||
if( dir != NULL )
|
||||
{
|
||||
dir->update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::contextMenuEvent( QContextMenuEvent * _e )
|
||||
{
|
||||
fileItem * f = dynamic_cast<fileItem *>( itemAt( _e->pos() ) );
|
||||
if( f != NULL && ( f->type() == fileItem::SAMPLE_FILE ||
|
||||
f->type() == fileItem::PRESET_FILE ) )
|
||||
{
|
||||
m_contextMenuItem = f;
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.addAction( tr( "Send to active instrument-track" ),
|
||||
this,
|
||||
SLOT( sendToActiveInstrumentTrack() ) );
|
||||
contextMenu.addAction( tr( "Open in new instrument-track/"
|
||||
"Song-Editor" ),
|
||||
this,
|
||||
SLOT( openInNewInstrumentTrackSE() ) );
|
||||
contextMenu.addAction( tr( "Open in new instrument-track/"
|
||||
"B+B Editor" ),
|
||||
this,
|
||||
SLOT( openInNewInstrumentTrackBBE() ) );
|
||||
contextMenu.exec( _e->globalPos() );
|
||||
m_contextMenuItem = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void listView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
QTreeWidget::mousePressEvent( _me );
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QPoint p( contentsToViewport( _me->pos() ) );
|
||||
Q3ListViewItem * i = itemAt( p );
|
||||
QTreeWidgetItem * i = itemAt( _me->pos() );
|
||||
if ( i )
|
||||
{
|
||||
if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) +
|
||||
treeStepSize() * ( i->depth() + ( rootIsDecorated() ?
|
||||
1 : 0 ) ) + itemMargin() ||
|
||||
p.x() < header()->cellPos(
|
||||
header()->mapToActual( 0 ) ) )
|
||||
{
|
||||
// TODO: Restrict to visible selection
|
||||
// if ( _me->x() > header()->cellPos( header()->mapToActual( 0 ) )
|
||||
// + treeStepSize() * ( i->depth() + ( rootIsDecorated() ?
|
||||
// 1 : 0 ) ) + itemMargin() ||
|
||||
// _me->x() < header()->cellPos(
|
||||
// header()->mapToActual( 0 ) ) )
|
||||
// {
|
||||
m_pressPos = _me->pos();
|
||||
m_mousePressed = TRUE;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
fileItem * f = dynamic_cast<fileItem *>( i );
|
||||
@@ -542,15 +526,14 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void listView::contentsMouseMoveEvent( QMouseEvent * _me )
|
||||
void listView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_mousePressed == TRUE &&
|
||||
( m_pressPos - _me->pos() ).manhattanLength() >
|
||||
QApplication::startDragDistance() )
|
||||
{
|
||||
contentsMouseReleaseEvent( NULL );
|
||||
fileItem * f = dynamic_cast<fileItem *>( itemAt(
|
||||
contentsToViewport( m_pressPos ) ) );
|
||||
mouseReleaseEvent( NULL );
|
||||
fileItem * f = dynamic_cast<fileItem *>( itemAt( m_pressPos ) );
|
||||
if( f != NULL )
|
||||
{
|
||||
switch( f->type() )
|
||||
@@ -589,7 +572,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void listView::contentsMouseReleaseEvent( QMouseEvent * _me )
|
||||
void listView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( !m_pphMutex.tryLock() )
|
||||
{
|
||||
@@ -632,35 +615,29 @@ QPixmap * directory::s_folderOpenedPixmap = NULL;
|
||||
QPixmap * directory::s_folderLockedPixmap = NULL;
|
||||
|
||||
|
||||
directory::directory( directory * _parent, const QString & _name,
|
||||
const QString & _path, const QString & _filter ) :
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
m_p( _parent ),
|
||||
m_pix( NULL ),
|
||||
directory::directory( const QString & _name, const QString & _path,
|
||||
const QString & _filter ) :
|
||||
m_directories( _path ),
|
||||
m_filter( _filter )
|
||||
{
|
||||
initPixmapStuff();
|
||||
|
||||
setText( 0, _name );
|
||||
setChildIndicatorPolicy( QTreeWidgetItem::ShowIndicator );
|
||||
|
||||
if( !QDir( fullName() ).isReadable() )
|
||||
{
|
||||
setIcon( 0, *s_folderLockedPixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
setIcon( 0, *s_folderPixmap );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
directory::directory( Q3ListView * _parent, const QString & _name,
|
||||
const QString & _path, const QString & _filter ) :
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
m_p( NULL ),
|
||||
m_pix( NULL ),
|
||||
m_directories( _path ),
|
||||
m_filter( _filter )
|
||||
{
|
||||
initPixmapStuff();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void directory::initPixmapStuff( void )
|
||||
{
|
||||
if( s_folderPixmap == NULL )
|
||||
@@ -680,68 +657,39 @@ void directory::initPixmapStuff( void )
|
||||
s_folderLockedPixmap = new QPixmap(
|
||||
embed::getIconPixmap( "folder_locked" ) );
|
||||
}
|
||||
|
||||
if( !QDir( fullName() ).isReadable() )
|
||||
{
|
||||
setPixmap( s_folderLockedPixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
setPixmap( s_folderPixmap );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void directory::setPixmap( const QPixmap * _px )
|
||||
void directory::update( void )
|
||||
{
|
||||
m_pix = _px;
|
||||
setup();
|
||||
widthChanged( 0 );
|
||||
invalidateHeight();
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void directory::setOpen( bool _o )
|
||||
{
|
||||
if( _o )
|
||||
if( !isExpanded() )
|
||||
{
|
||||
setPixmap( s_folderOpenedPixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
setPixmap( s_folderPixmap );
|
||||
setIcon( 0, *s_folderPixmap );
|
||||
return;
|
||||
}
|
||||
|
||||
if( _o && !childCount() )
|
||||
setIcon( 0, *s_folderOpenedPixmap );
|
||||
if( !childCount() )
|
||||
{
|
||||
for( QStringList::iterator it = m_directories.begin();
|
||||
it != m_directories.end(); ++it )
|
||||
{
|
||||
int top_index = childCount();
|
||||
if( addItems( fullName( *it ) ) &&
|
||||
( *it ).contains(
|
||||
configManager::inst()->dataDir() ) )
|
||||
{
|
||||
( new Q3ListViewItem( this,
|
||||
listView::tr( "--- Factory files ---" ) ) )->setPixmap( 0,
|
||||
embed::getIconPixmap( "factory_files" ) );
|
||||
QTreeWidgetItem * sep = new QTreeWidgetItem;
|
||||
sep->setText( 0, listView::tr(
|
||||
"--- Factory files ---" ) );
|
||||
sep->setIcon( 0, embed::getIconPixmap(
|
||||
"factory_files" ) );
|
||||
insertChild( top_index, sep );
|
||||
}
|
||||
}
|
||||
}
|
||||
Q3ListViewItem::setOpen( _o );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void directory::setup( void )
|
||||
{
|
||||
setExpandable( TRUE );
|
||||
Q3ListViewItem::setup();
|
||||
}
|
||||
|
||||
|
||||
@@ -752,19 +700,56 @@ bool directory::addItems( const QString & _path )
|
||||
QDir thisDir( _path );
|
||||
if( !thisDir.isReadable() )
|
||||
{
|
||||
//readable = FALSE;
|
||||
setExpandable( FALSE );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
listView()->setUpdatesEnabled( FALSE );
|
||||
treeWidget()->setUpdatesEnabled( FALSE );
|
||||
|
||||
bool added_something = FALSE;
|
||||
|
||||
QStringList files = thisDir.entryList( QDir::Files, QDir::Name );
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
QStringList files = thisDir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( QStringList::const_iterator it = files.constBegin();
|
||||
it != files.constEnd(); ++it )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.' && fileBrowser::isDirWithContent(
|
||||
thisDir.absolutePath() + QDir::separator() +
|
||||
cur_file, m_filter ) )
|
||||
{
|
||||
bool orphan = TRUE;
|
||||
for( int i = 0; i < childCount(); ++i )
|
||||
{
|
||||
directory * d = dynamic_cast<directory *>(
|
||||
child( i ) );
|
||||
if( d == NULL || cur_file < d->text( 0 ) )
|
||||
{
|
||||
insertChild( i, new directory( cur_file,
|
||||
_path, m_filter ) );
|
||||
orphan = FALSE;
|
||||
break;
|
||||
}
|
||||
else if( cur_file == d->text( 0 ) )
|
||||
{
|
||||
d->addDirectory( _path );
|
||||
orphan = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( orphan )
|
||||
{
|
||||
addChild( new directory( cur_file, _path,
|
||||
m_filter ) );
|
||||
}
|
||||
|
||||
added_something = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
files = thisDir.entryList( QDir::Files, QDir::Name );
|
||||
for( QStringList::const_iterator it = files.constBegin();
|
||||
it != files.constEnd(); ++it )
|
||||
{
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.'
|
||||
&& thisDir.match( m_filter, cur_file.toLower() )
|
||||
/*QDir::match( FILE_FILTER, cur_file )*/ )
|
||||
@@ -774,44 +759,7 @@ bool directory::addItems( const QString & _path )
|
||||
}
|
||||
}
|
||||
|
||||
files = thisDir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.' && fileBrowser::isDirWithContent(
|
||||
thisDir.absolutePath() + QDir::separator() +
|
||||
cur_file, m_filter ) )
|
||||
{
|
||||
new directory( this, cur_file, _path, m_filter );
|
||||
added_something = TRUE;
|
||||
#if 0
|
||||
if( firstChild() == NULL )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool moved = FALSE;
|
||||
QListViewItem * item = firstChild();
|
||||
while( item != NULL )
|
||||
{
|
||||
directory * cd =
|
||||
dynamic_cast<directory *>( item );
|
||||
if( cd != NULL )
|
||||
{
|
||||
/* if( moved == FALSE ||
|
||||
cd->text( 0 ) < cur_file )
|
||||
{*/
|
||||
printf( "move item %s after %s\n", d->text(0).ascii(), cd->text(0).ascii());
|
||||
d->moveItem( cd );
|
||||
moved = TRUE;
|
||||
//}
|
||||
}
|
||||
item = item->nextSibling();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
listView()->setUpdatesEnabled( TRUE );
|
||||
treeWidget()->setUpdatesEnabled( TRUE );
|
||||
|
||||
return( added_something );
|
||||
}
|
||||
@@ -827,29 +775,27 @@ QPixmap * fileItem::s_flpFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_unknownFilePixmap = NULL;
|
||||
|
||||
|
||||
fileItem::fileItem( Q3ListView * _parent, const QString & _name,
|
||||
fileItem::fileItem( QTreeWidget * _parent, const QString & _name,
|
||||
const QString & _path ) :
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
m_pix( NULL ),
|
||||
QTreeWidgetItem( _parent ),
|
||||
m_path( _path )
|
||||
{
|
||||
setText( 0, _name );
|
||||
determineFileType();
|
||||
initPixmapStuff();
|
||||
setDragEnabled( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fileItem::fileItem( Q3ListViewItem * _parent, const QString & _name,
|
||||
fileItem::fileItem( QTreeWidgetItem * _parent, const QString & _name,
|
||||
const QString & _path ) :
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
m_pix( NULL ),
|
||||
QTreeWidgetItem( _parent ),
|
||||
m_path( _path )
|
||||
{
|
||||
setText( 0, _name );
|
||||
determineFileType();
|
||||
initPixmapStuff();
|
||||
setDragEnabled( TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -895,14 +841,24 @@ void fileItem::initPixmapStuff( void )
|
||||
|
||||
switch( m_type )
|
||||
{
|
||||
case PROJECT_FILE: m_pix = s_projectFilePixmap; break;
|
||||
case PRESET_FILE: m_pix = s_presetFilePixmap; break;
|
||||
case SAMPLE_FILE: m_pix = s_sampleFilePixmap; break;
|
||||
case MIDI_FILE: m_pix = s_midiFilePixmap; break;
|
||||
case FLP_FILE: m_pix = s_flpFilePixmap; break;
|
||||
case PROJECT_FILE:
|
||||
setIcon( 0, *s_projectFilePixmap );
|
||||
break;
|
||||
case PRESET_FILE:
|
||||
setIcon( 0, *s_presetFilePixmap );
|
||||
break;
|
||||
case SAMPLE_FILE:
|
||||
setIcon( 0, *s_sampleFilePixmap );
|
||||
break;
|
||||
case MIDI_FILE:
|
||||
setIcon( 0, *s_midiFilePixmap );
|
||||
break;
|
||||
case FLP_FILE:
|
||||
setIcon( 0, *s_flpFilePixmap );
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
m_pix = s_unknownFilePixmap;
|
||||
setIcon( 0, *s_unknownFilePixmap );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,6 @@ bool importFilter::openFile( void )
|
||||
}
|
||||
|
||||
|
||||
#undef fileName
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -978,7 +978,3 @@ bool FASTCALL ladspaManager::cleanup( const ladspa_key_t & _plugin,
|
||||
}
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
#undef value
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ int main( int argc, char * * argv )
|
||||
"version 2 of the License, or (at your option) any later version.\n\n"
|
||||
"Try \"%s --help\" for more information.\n\n", PACKAGE_VERSION,
|
||||
argv[0] );
|
||||
return( 0 );
|
||||
return( EXIT_SUCCESS );
|
||||
}
|
||||
else if( argc > i && ( QString( argv[i] ) == "--help" ||
|
||||
QString( argv[i] ) == "-h" ) )
|
||||
@@ -114,7 +114,7 @@ int main( int argc, char * * argv )
|
||||
"-v, --version show version information and exit.\n"
|
||||
"-h, --help show this usage message and exit.\n\n",
|
||||
PACKAGE_VERSION );
|
||||
return( 0 );
|
||||
return( EXIT_SUCCESS );
|
||||
}
|
||||
else if( argc > i && ( QString( argv[i] ) == "--render" ||
|
||||
QString( argv[i] ) == "-r" ) )
|
||||
@@ -132,7 +132,7 @@ int main( int argc, char * * argv )
|
||||
{
|
||||
printf( "\nInvalid output format %s.\n\n"
|
||||
"Try \"%s --help\" for more information.\n\n", argv[i + 1], argv[0] );
|
||||
return( -1 );
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
++i;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ int main( int argc, char * * argv )
|
||||
{
|
||||
printf( "\nInvalid option %s.\n\n"
|
||||
"Try \"%s --help\" for more information.\n\n", argv[i], argv[0] );
|
||||
return( -1 );
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
file_to_load = argv[i];
|
||||
}
|
||||
@@ -156,12 +156,8 @@ int main( int argc, char * * argv )
|
||||
|
||||
QString pos = QLocale::system().name().left( 2 );
|
||||
// load translation for Qt-widgets/-dialogs
|
||||
#ifdef QT_TRANSLATIONS_DIR
|
||||
loadTranslation( QString( "qt_" ) + pos,
|
||||
QString( QT_TRANSLATIONS_DIR ) );
|
||||
#else
|
||||
loadTranslation( QString( "qt_" ) + pos );
|
||||
#endif
|
||||
// load actual translation for LMMS
|
||||
loadTranslation( pos );
|
||||
|
||||
@@ -170,7 +166,7 @@ int main( int argc, char * * argv )
|
||||
|
||||
if( !configManager::inst()->loadConfigFile() )
|
||||
{
|
||||
return( -1 );
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
QPalette pal = app.palette();
|
||||
|
||||
@@ -28,15 +28,16 @@
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QDesktopServices>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QSplashScreen>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QSplashScreen>
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -112,21 +113,21 @@ mainWindow::mainWindow( void ) :
|
||||
QString wdir = configManager::inst()->workingDir();
|
||||
side_bar->appendTab( new pluginBrowser( splitter ), ++id );
|
||||
side_bar->appendTab( new fileBrowser(
|
||||
configManager::inst()->factoryProjectsDir() + "*" +
|
||||
configManager::inst()->userProjectsDir(),
|
||||
configManager::inst()->userProjectsDir() + "*" +
|
||||
configManager::inst()->factoryProjectsDir(),
|
||||
"*.mmp *.mmpz *.xml *.mid *.flp",
|
||||
tr( "My projects" ),
|
||||
embed::getIconPixmap( "project_file" ),
|
||||
splitter ), ++id );
|
||||
side_bar->appendTab( new fileBrowser(
|
||||
configManager::inst()->factorySamplesDir() + "*" +
|
||||
configManager::inst()->userSamplesDir(),
|
||||
configManager::inst()->userSamplesDir() + "*" +
|
||||
configManager::inst()->factorySamplesDir(),
|
||||
sample_filter, tr( "My samples" ),
|
||||
embed::getIconPixmap( "sound_file" ),
|
||||
splitter ), ++id );
|
||||
side_bar->appendTab( new fileBrowser(
|
||||
configManager::inst()->factoryPresetsDir() + "*" +
|
||||
configManager::inst()->userPresetsDir(),
|
||||
configManager::inst()->userPresetsDir() + "*" +
|
||||
configManager::inst()->factoryPresetsDir(),
|
||||
"*.cs.xml", tr( "My presets" ),
|
||||
embed::getIconPixmap( "preset_file" ),
|
||||
splitter ), ++id );
|
||||
@@ -143,13 +144,8 @@ mainWindow::mainWindow( void ) :
|
||||
{
|
||||
m_workspace = new QWorkspace( splitter );
|
||||
m_workspace->setScrollBarsEnabled( TRUE );
|
||||
|
||||
#warning TODO
|
||||
m_workspace->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_workspace->backgroundRole(),
|
||||
embed::getIconPixmap( "background_artwork" ) );
|
||||
m_workspace->setPalette( pal );
|
||||
m_workspace->setBackground( embed::getIconPixmap(
|
||||
"background_artwork" ) );
|
||||
}
|
||||
|
||||
hbox->addWidget( side_bar );
|
||||
@@ -158,13 +154,9 @@ mainWindow::mainWindow( void ) :
|
||||
|
||||
// create global-toolbar at the top of our window
|
||||
m_toolBar = new QWidget( main_widget );
|
||||
m_toolBar->setObjectName( "mainToolbar" );
|
||||
m_toolBar->setFixedHeight( 64 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "main_toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
|
||||
// add layout for organizing quite complex toolbar-layouting
|
||||
m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ );
|
||||
@@ -221,8 +213,8 @@ void mainWindow::finalize( void )
|
||||
m_toolBar );
|
||||
|
||||
m_templatesMenu = new QMenu( project_new );
|
||||
connect( m_templatesMenu, SIGNAL( aboutToShow( void ) ),
|
||||
this, SLOT( fillTemplatesMenu( void ) ) );
|
||||
connect( m_templatesMenu, SIGNAL( aboutToShow() ),
|
||||
this, SLOT( fillTemplatesMenu() ) );
|
||||
connect( m_templatesMenu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( createNewProjectFromTemplate( QAction * ) ) );
|
||||
project_new->setMenu( m_templatesMenu );
|
||||
@@ -357,11 +349,6 @@ void mainWindow::finalize( void )
|
||||
m_toolBarLayout->setColumnStretch( 100, 1 );
|
||||
|
||||
|
||||
m_recentlyOpenedProjectsMenu = new QMenu( NULL );
|
||||
connect( m_recentlyOpenedProjectsMenu, SIGNAL( activated( int ) ),
|
||||
this, SLOT( openRecentlyOpenedProject( int ) ) );
|
||||
updateRecentlyOpenedProjectsMenu();
|
||||
|
||||
// project-popup-menu
|
||||
QMenu * project_menu = new QMenu( this );
|
||||
menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) );
|
||||
@@ -374,10 +361,14 @@ void mainWindow::finalize( void )
|
||||
tr( "&Open..." ),
|
||||
this, SLOT( openProject() ),
|
||||
Qt::CTRL + Qt::Key_O );
|
||||
/*
|
||||
project_menu->addAction( embed::getIconPixmap( "project_open" ),
|
||||
tr( "Recently opened projects" ),
|
||||
m_recentlyOpenedProjectsMenu );*/
|
||||
|
||||
m_recentlyOpenedProjectsMenu = project_menu->addMenu(
|
||||
embed::getIconPixmap( "project_open" ),
|
||||
tr( "Recently opened projects" ) );
|
||||
connect( m_recentlyOpenedProjectsMenu, SIGNAL( aboutToShow() ),
|
||||
this, SLOT( updateRecentlyOpenedProjectsMenu() ) );
|
||||
connect( m_recentlyOpenedProjectsMenu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( openRecentlyOpenedProject( QAction * ) ) );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "&Save" ),
|
||||
@@ -649,13 +640,11 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::openRecentlyOpenedProject( int _id )
|
||||
void mainWindow::openRecentlyOpenedProject( QAction * _action )
|
||||
{
|
||||
#warning TODO
|
||||
/* const QString & f = m_recentlyOpenedProjectsMenu->text( _id );
|
||||
const QString & f = _action->text();
|
||||
engine::getSongEditor()->loadProject( f );
|
||||
configManager::inst()->addRecentlyOpenedProject( f );
|
||||
updateRecentlyOpenedProjectsMenu();*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,15 +26,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "piano_roll.h"
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
@@ -44,7 +48,6 @@
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "piano_roll.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "clipboard.h"
|
||||
#include "combobox.h"
|
||||
|
||||
@@ -26,16 +26,17 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "piano_widget.h"
|
||||
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
|
||||
#include "piano_widget.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument_track.h"
|
||||
@@ -217,17 +218,7 @@ void pianoWidget::contextMenuEvent( QContextMenuEvent * _me )
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#warning TODO: use CSS-formatting
|
||||
contextMenu.setTitle( m_noteKnob->accessibleName() );
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( m_noteKnob->accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( m_noteKnob->accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "&Open in automation editor" ),
|
||||
m_noteKnob->getAutomationPattern(),
|
||||
|
||||
@@ -639,7 +639,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
m_tabBar->addTab( midi, tr( "MIDI settings" ), 4, TRUE, TRUE
|
||||
)->setIcon( embed::getIconPixmap( "setup_midi" ) );
|
||||
|
||||
#undef setIcon
|
||||
|
||||
m_tabBar->setActiveTab( _tab_to_open );
|
||||
|
||||
|
||||
@@ -1499,7 +1499,6 @@ void FASTCALL songEditor::loadProject( const QString & _file_name )
|
||||
configManager::inst()->addRecentlyOpenedProject( _file_name );
|
||||
|
||||
engine::getMainWindow()->resetWindowTitle( "" );
|
||||
engine::getMainWindow()->updateRecentlyOpenedProjectsMenu();
|
||||
|
||||
engine::getProjectJournal()->setJournalling( TRUE );
|
||||
}
|
||||
@@ -1525,6 +1524,7 @@ bool songEditor::saveProject( void )
|
||||
mmp.content() );
|
||||
m_playPos[PLAY_SONG].m_timeLine->saveState( mmp, mmp.content() );
|
||||
|
||||
m_fileName = mmp.nameWithExtension( m_fileName );
|
||||
if( mmp.writeFile( m_fileName, m_oldFileName == "" ||
|
||||
m_fileName != m_oldFileName ) == TRUE )
|
||||
{
|
||||
@@ -1537,7 +1537,6 @@ bool songEditor::saveProject( void )
|
||||
2000 );
|
||||
configManager::inst()->addRecentlyOpenedProject( m_fileName );
|
||||
engine::getMainWindow()->resetWindowTitle( "" );
|
||||
engine::getMainWindow()->updateRecentlyOpenedProjectsMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,18 +26,16 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "surround_area.h"
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "surround_area.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "knob.h"
|
||||
#include "templates.h"
|
||||
@@ -164,8 +162,7 @@ void surroundArea::contextMenuEvent( QContextMenuEvent * )
|
||||
// an QApplication::restoreOverrideCursor()-call...
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open &X in automation editor" ),
|
||||
m_position_x->getAutomationPattern(),
|
||||
|
||||
@@ -26,9 +26,12 @@
|
||||
|
||||
|
||||
#include "tool.h"
|
||||
#include "main_window.h"
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -450,7 +450,6 @@ void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme )
|
||||
contextMenu.exec( QCursor::pos() );
|
||||
}
|
||||
|
||||
#undef addSeparator
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,13 +26,16 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "track_container.h"
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QProgressDialog>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#include "track_container.h"
|
||||
#include "bb_track.h"
|
||||
#include "config_mgr.h"
|
||||
#include "debug.h"
|
||||
@@ -591,7 +594,5 @@ void trackContainer::scrollArea::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
#include "track_container.moc"
|
||||
|
||||
#undef setValue
|
||||
#undef maximum
|
||||
|
||||
#endif
|
||||
|
||||
@@ -188,57 +188,53 @@ multimediaProject::~multimediaProject()
|
||||
|
||||
|
||||
|
||||
QString multimediaProject::nameWithExtension( const QString & _fn ) const
|
||||
{
|
||||
switch( type() )
|
||||
{
|
||||
case SONG_PROJECT:
|
||||
if( _fn.section( '.', -1 ) != "mmp" &&
|
||||
_fn.section( '.', -1 ) != "mpt" &&
|
||||
_fn.section( '.', -1 ) != "mmpz" )
|
||||
{
|
||||
if( configManager::inst()->value( "app",
|
||||
"nommpz" ).toInt() == 0 )
|
||||
{
|
||||
return( _fn + ".mmpz" );
|
||||
}
|
||||
return( _fn + ".mmp" );
|
||||
}
|
||||
break;
|
||||
case SONG_PROJECT_TEMPLATE:
|
||||
if( _fn.section( '.',-1 ) != "mpt" )
|
||||
{
|
||||
return( _fn + ".mpt" );
|
||||
}
|
||||
break;
|
||||
case INSTRUMENT_TRACK_SETTINGS:
|
||||
if( _fn.section( '.', -2, -1 ) != "cs.xml" )
|
||||
{
|
||||
return( _fn + ".cs.xml" );
|
||||
}
|
||||
break;
|
||||
default: ;
|
||||
}
|
||||
return( _fn );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
{
|
||||
bool clean_meta_nodes = FALSE;
|
||||
QString fn = _fn;
|
||||
bool compress = FALSE;
|
||||
if( type() == INSTRUMENT_TRACK_SETTINGS )
|
||||
{
|
||||
if( fn.section( '.', -2, -1 ) != "cs.xml" )
|
||||
{
|
||||
fn += ".cs.xml";
|
||||
}
|
||||
clean_meta_nodes = TRUE;
|
||||
}
|
||||
else if( type() == SONG_PROJECT )
|
||||
{
|
||||
if( fn.section( '.', -1 ) != "mmp" &&
|
||||
fn.section( '.', -1 ) != "mpt" &&
|
||||
fn.section( '.', -1 ) != "mmpz" )
|
||||
{
|
||||
compress = configManager::inst()->value( "app",
|
||||
"nommpz" ).toInt() == 0;
|
||||
if( compress )
|
||||
{
|
||||
fn += ".mmpz";
|
||||
}
|
||||
else
|
||||
{
|
||||
fn += ".mmp";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
compress = ( fn.section( '.', -1 ) == "mmpz" );
|
||||
}
|
||||
clean_meta_nodes = TRUE;
|
||||
}
|
||||
else if( type() == SONG_PROJECT_TEMPLATE )
|
||||
{
|
||||
if( fn.section( '.',-1 ) != "mpt" )
|
||||
{
|
||||
fn += ".mpt";
|
||||
}
|
||||
clean_meta_nodes = TRUE;
|
||||
}
|
||||
|
||||
if( clean_meta_nodes == TRUE )
|
||||
if( type() == SONG_PROJECT || type() == SONG_PROJECT_TEMPLATE
|
||||
|| type() == INSTRUMENT_TRACK_SETTINGS )
|
||||
{
|
||||
cleanMetaNodes( documentElement() );
|
||||
}
|
||||
|
||||
|
||||
QString fn = nameWithExtension( _fn );
|
||||
QFile outfile( fn );
|
||||
if( _overwrite_check == TRUE &&
|
||||
outfile.exists() == TRUE &&
|
||||
@@ -271,7 +267,7 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
return( FALSE );
|
||||
}
|
||||
QString xml = "<?xml version=\"1.0\"?>\n" + toString( 1 );
|
||||
if( compress )
|
||||
if( fn.section( '.', -1 ) == "mmpz" )
|
||||
{
|
||||
outfile.write( qCompress( xml.toAscii() ) );
|
||||
}
|
||||
|
||||
@@ -1268,11 +1268,6 @@ sampleBuffer::handleState::~handleState()
|
||||
|
||||
|
||||
|
||||
#undef write
|
||||
#undef read
|
||||
#undef pos
|
||||
|
||||
|
||||
#include "sample_buffer.moc"
|
||||
|
||||
|
||||
|
||||
@@ -60,11 +60,12 @@ midiALSASeq::midiALSASeq( void ) :
|
||||
|
||||
m_queueID = snd_seq_alloc_queue( m_seqHandle );
|
||||
snd_seq_queue_tempo_t * tempo;
|
||||
snd_seq_queue_tempo_alloca( &tempo );
|
||||
snd_seq_queue_tempo_malloc( &tempo );
|
||||
snd_seq_queue_tempo_set_tempo( tempo, 6000000 /
|
||||
engine::getSongEditor()->getTempo() );
|
||||
snd_seq_queue_tempo_set_ppq( tempo, 16 );
|
||||
snd_seq_set_queue_tempo( m_seqHandle, m_queueID, tempo );
|
||||
snd_seq_queue_tempo_free( tempo );
|
||||
|
||||
snd_seq_start_queue( m_seqHandle, m_queueID, NULL );
|
||||
changeQueueTempo( engine::getSongEditor()->getTempo() );
|
||||
@@ -341,8 +342,9 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port,
|
||||
snd_seq_port_info_malloc( &port_info );
|
||||
snd_seq_get_port_info( m_seqHandle, m_portIDs[_port][0], port_info );
|
||||
const snd_seq_addr_t * dest = snd_seq_port_info_get_addr( port_info );
|
||||
snd_seq_port_info_free( port_info );
|
||||
snd_seq_port_subscribe_t * subs;
|
||||
snd_seq_port_subscribe_alloca( &subs );
|
||||
snd_seq_port_subscribe_malloc( &subs );
|
||||
snd_seq_port_subscribe_set_sender( subs, &sender );
|
||||
snd_seq_port_subscribe_set_dest( subs, dest );
|
||||
if( _unsubscribe )
|
||||
@@ -353,7 +355,7 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port,
|
||||
{
|
||||
snd_seq_subscribe_port( m_seqHandle, subs );
|
||||
}
|
||||
snd_seq_port_info_free( port_info );
|
||||
snd_seq_port_subscribe_free( subs );
|
||||
}
|
||||
|
||||
|
||||
@@ -383,8 +385,9 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port,
|
||||
m_portIDs[_port][1],
|
||||
port_info );
|
||||
const snd_seq_addr_t * sender = snd_seq_port_info_get_addr( port_info );
|
||||
snd_seq_port_info_free( port_info );
|
||||
snd_seq_port_subscribe_t * subs;
|
||||
snd_seq_port_subscribe_alloca( &subs );
|
||||
snd_seq_port_subscribe_malloc( &subs );
|
||||
snd_seq_port_subscribe_set_sender( subs, sender );
|
||||
snd_seq_port_subscribe_set_dest( subs, &dest );
|
||||
if( _unsubscribe )
|
||||
@@ -395,7 +398,7 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port,
|
||||
{
|
||||
snd_seq_subscribe_port( m_seqHandle, subs );
|
||||
}
|
||||
snd_seq_port_info_free( port_info );
|
||||
snd_seq_port_subscribe_free( subs );
|
||||
}
|
||||
|
||||
|
||||
@@ -547,8 +550,8 @@ void midiALSASeq::updatePortList( void )
|
||||
snd_seq_client_info_t * cinfo;
|
||||
snd_seq_port_info_t * pinfo;
|
||||
|
||||
snd_seq_client_info_alloca( &cinfo );
|
||||
snd_seq_port_info_alloca( &pinfo );
|
||||
snd_seq_client_info_malloc( &cinfo );
|
||||
snd_seq_port_info_malloc( &pinfo );
|
||||
|
||||
snd_seq_client_info_set_client( cinfo, -1 );
|
||||
while( snd_seq_query_next_client( m_seqHandle, cinfo ) >= 0 )
|
||||
@@ -597,8 +600,8 @@ void midiALSASeq::updatePortList( void )
|
||||
}
|
||||
}
|
||||
|
||||
/* snd_seq_client_info_free( cinfo );
|
||||
snd_seq_port_info_free( pinfo );*/
|
||||
snd_seq_client_info_free( cinfo );
|
||||
snd_seq_port_info_free( pinfo );
|
||||
|
||||
if( m_readablePorts != readable_ports )
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* midi_mapper.cpp - MIDI-mapper for any midiDevice
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -213,7 +213,5 @@ void midiMapper::readChannelMap( QFile & _f )
|
||||
|
||||
|
||||
|
||||
#undef indexOf
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "instrument_track.h"
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
@@ -37,9 +40,9 @@
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
|
||||
#include "instrument_track.h"
|
||||
#include "arp_and_chords_tab_widget.h"
|
||||
#include "audio_port.h"
|
||||
#include "automation_pattern.h"
|
||||
|
||||
@@ -26,17 +26,18 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "automatable_button.h"
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include "automatable_button.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
|
||||
automatableButton::automatableButton( QWidget * _parent, const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent ),
|
||||
@@ -93,17 +94,7 @@ void automatableButton::contextMenuEvent( QContextMenuEvent * _me )
|
||||
pattern = getAutomationPattern();
|
||||
}
|
||||
|
||||
QMenu contextMenu( target );
|
||||
#warning TODO: set according CSS-formatting
|
||||
contextMenu.setTitle( target->accessibleName() );
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( target->accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( target->accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "&Open in automation editor" ),
|
||||
pattern,
|
||||
|
||||
@@ -25,14 +25,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "automatable_slider.h"
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include "automatable_slider.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "knob.h"
|
||||
|
||||
@@ -96,22 +95,7 @@ void automatableSlider::setInitValue( int _value )
|
||||
|
||||
void automatableSlider::contextMenuEvent( QContextMenuEvent * _me )
|
||||
{
|
||||
// for the case, the user clicked right while pressing left mouse-
|
||||
// button, the context-menu appears while mouse-cursor is still hidden
|
||||
// and it isn't shown again until user does something which causes
|
||||
// an QApplication::restoreOverrideCursor()-call...
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#warning TODO: use according CSS formatting
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "&Open in automation editor" ),
|
||||
m_knob->getAutomationPattern(),
|
||||
|
||||
53
src/widgets/caption_menu.cpp
Normal file
53
src/widgets/caption_menu.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* caption_menu.cpp - context menu with a caption
|
||||
*
|
||||
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 "caption_menu.h"
|
||||
|
||||
|
||||
|
||||
|
||||
captionMenu::captionMenu( const QString & _title, QWidget * _parent ) :
|
||||
QMenu( _title, _parent )
|
||||
{
|
||||
QAction * caption = addAction( _title );
|
||||
caption->setEnabled( FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
captionMenu::~captionMenu()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "caption_menu.moc"
|
||||
|
||||
|
||||
#endif
|
||||
@@ -25,17 +25,17 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "combobox.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QDesktopWidget>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#include "combobox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
@@ -146,17 +146,7 @@ void comboBox::contextMenuEvent( QContextMenuEvent * _me )
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#warning TODO: add css-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "&Open in automation editor" ),
|
||||
getAutomationPattern(),
|
||||
|
||||
@@ -26,17 +26,20 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include "effect_label.h"
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QWorkspace>
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "effect_tab_widget.h"
|
||||
#include "sample_track.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "main_window.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "sample_track.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
/*
|
||||
* kmultitabbar.cpp - widget for horizontal and vertical tabs
|
||||
*
|
||||
* Copyright (c) 2001-2003 Joseph Wenninger <jowenn@kde.org>
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 "kmultitabbar.h"
|
||||
|
||||
@@ -16,6 +39,9 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
#define NEARBYINT(i) ((int(float(i) + 0.5)))
|
||||
|
||||
class KMultiTabBarTabPrivate {
|
||||
@@ -87,7 +113,7 @@ void KMultiTabBarInternal::setStyle(enum KMultiTabBar::KMultiTabBarStyle style)
|
||||
diff=0; \
|
||||
for (int i2=i;i2<tabCount;i2++) {\
|
||||
int l1=m_tabs.at(i2)->neededSize();\
|
||||
if ((ulen+l1)>space){\
|
||||
if ((ulen+l1)>(int)space){\
|
||||
if (ulen==0) diff=0;\
|
||||
else diff=((float)(space-ulen))/(i2-i);\
|
||||
break;\
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "knob.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QFontMetrics>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPalette>
|
||||
@@ -44,17 +44,17 @@
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
#include "knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "caption_menu.h"
|
||||
#include "config_mgr.h"
|
||||
#include "text_float.h"
|
||||
#include "mixer.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "main_window.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "templates.h"
|
||||
#include "text_float.h"
|
||||
|
||||
|
||||
|
||||
@@ -321,16 +321,7 @@ void knob::contextMenuEvent( QContextMenuEvent * )
|
||||
// an QApplication::restoreOverrideCursor()-call...
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#warning TODO: css-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "reload" ),
|
||||
tr( "&Reset (%1%2)" ).arg( m_initValue ).arg(
|
||||
m_hintTextAfterValue ),
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
@@ -171,16 +171,7 @@ void lcdSpinBox::contextMenuEvent( QContextMenuEvent * _me )
|
||||
// an QApplication::restoreOverrideCursor()-call...
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "&Open in automation editor" ),
|
||||
getAutomationPattern(),
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "project_notes.h"
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -35,8 +37,8 @@
|
||||
#include <QtGui/QTextCursor>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
#include "project_notes.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
|
||||
@@ -26,24 +26,23 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QWhatsThis>
|
||||
#include <QtGui/QColor>
|
||||
|
||||
#include "rack_plugin.h"
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
#include "audio_port.h"
|
||||
#include "knob.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "tooltip.h"
|
||||
#include "caption_menu.h"
|
||||
#include "effect_control_dialog.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "knob.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "main_window.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
rackPlugin::rackPlugin( QWidget * _parent,
|
||||
@@ -239,31 +238,21 @@ void rackPlugin::setGate( float _value )
|
||||
|
||||
void rackPlugin::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QPointer<QMenu> contextMenu = new QMenu( this );
|
||||
contextMenu->setTitle( m_effect->publicName() );
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( m_effect->publicName() ) +
|
||||
"</b></font>",
|
||||
this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu->addAction( caption );
|
||||
#endif
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_up_on" ),
|
||||
tr( "Move &up" ),
|
||||
QPointer<captionMenu> contextMenu = new captionMenu(
|
||||
m_effect->publicName() );
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_up_on" ),
|
||||
tr( "Move &up" ),
|
||||
this, SLOT( moveUp() ) );
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_down_on" ),
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_down_on" ),
|
||||
tr( "Move &down" ),
|
||||
this, SLOT( moveDown() ) );
|
||||
contextMenu->addSeparator();
|
||||
contextMenu->addAction( embed::getIconPixmap( "cancel" ),
|
||||
contextMenu->addAction( embed::getIconPixmap( "cancel" ),
|
||||
tr( "&Remove this plugin" ),
|
||||
this, SLOT( deletePlugin() ) );
|
||||
contextMenu->addSeparator();
|
||||
contextMenu->addAction( embed::getIconPixmap( "help" ),
|
||||
tr( "&Help" ),
|
||||
contextMenu->addAction( embed::getIconPixmap( "help" ),
|
||||
tr( "&Help" ),
|
||||
this, SLOT( displayHelp() ) );
|
||||
contextMenu->exec( QCursor::pos() );
|
||||
delete contextMenu;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* tab_bar.cpp - implementation of tab-bar
|
||||
*
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -241,9 +241,6 @@ bool tabBar::allHidden( void )
|
||||
|
||||
|
||||
|
||||
#undef value
|
||||
#undef removeWidget
|
||||
|
||||
|
||||
#include "tab_bar.moc"
|
||||
#include "tab_button.moc"
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include "tempo_sync_knob.h"
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QWorkspace>
|
||||
|
||||
#include "automatable_object_templates.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "meter_dialog.h"
|
||||
@@ -73,16 +74,7 @@ tempoSyncKnob::~tempoSyncKnob()
|
||||
|
||||
void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QMenu contextMenu( this );
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "reload" ),
|
||||
tr( "&Reset (%1%2)" ).arg( m_initValue ).arg(
|
||||
m_hintTextAfterValue ),
|
||||
|
||||
@@ -242,7 +242,5 @@ void textFloat::updateSize( void )
|
||||
|
||||
|
||||
|
||||
#undef setParent
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user