fixed zooming-comboboxes in automation-editor and header-dependencies
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@706 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,5 +1,16 @@
|
||||
2008-02-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/automation_editor.h:
|
||||
* include/combobox.h:
|
||||
* src/core/song.cpp:
|
||||
* src/core/piano_roll.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/core/automation_editor.cpp:
|
||||
fixed zooming-comboboxes in automation-editor and header-dependencies
|
||||
|
||||
* src/widgets/combobox.cpp:
|
||||
update() after wheelEvent
|
||||
|
||||
* include/tool.h:
|
||||
* src/core/tool.cpp:
|
||||
* plugins/live_tool/live_tool.h:
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include "journalling_object.h"
|
||||
#include "midi_time.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "combobox.h"
|
||||
|
||||
|
||||
class QPainter;
|
||||
class QPixmap;
|
||||
class QScrollBar;
|
||||
|
||||
class comboBox;
|
||||
class notePlayHandle;
|
||||
class timeLine;
|
||||
class toolButton;
|
||||
@@ -118,8 +118,8 @@ protected slots:
|
||||
|
||||
void updatePosition( const midiTime & _t );
|
||||
|
||||
void zoomingXChanged( const QString & _zfac );
|
||||
void zoomingYChanged( const QString & _zfac );
|
||||
void zoomingXChanged( void );
|
||||
void zoomingYChanged( void );
|
||||
|
||||
|
||||
private:
|
||||
@@ -182,6 +182,9 @@ private:
|
||||
comboBox * m_zoomingYComboBox;
|
||||
comboBox * m_quantizeComboBox;
|
||||
|
||||
comboBoxModel m_zoomingXModel;
|
||||
comboBoxModel m_zoomingYModel;
|
||||
comboBoxModel m_quantizeModel;
|
||||
|
||||
automationPattern * m_pattern;
|
||||
int m_min_level;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* combobox.h - class comboBox, a very cool combo-box
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <QtCore/QPair>
|
||||
|
||||
#include "automatable_model.h"
|
||||
#include "automatable_model_templates.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
class comboBoxModel : public intModel
|
||||
@@ -138,11 +138,6 @@ private slots:
|
||||
void deletePixmap( QPixmap * _pixmap );
|
||||
void setItem( QAction * _item );
|
||||
|
||||
/*
|
||||
signals:
|
||||
void activated( const QString & );
|
||||
void valueChanged( int );*/
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -75,6 +75,10 @@ QPixmap * automationEditor::s_toolMove = NULL;
|
||||
|
||||
|
||||
automationEditor::automationEditor( void ) :
|
||||
QWidget(),
|
||||
m_zoomingXModel(),
|
||||
m_zoomingYModel(),
|
||||
m_quantizeModel(),
|
||||
m_pattern( NULL ),
|
||||
m_min_level( 0 ),
|
||||
m_max_level( 0 ),
|
||||
@@ -265,17 +269,16 @@ automationEditor::automationEditor( void ) :
|
||||
m_zoomingXComboBox = new comboBox( m_toolBar );
|
||||
m_zoomingXComboBox->setFixedSize( 80, 22 );
|
||||
|
||||
comboBoxModel * zoom_x_model = new comboBoxModel( /* this */ );
|
||||
for( int i = 0; i < 6; ++i )
|
||||
{
|
||||
zoom_x_model->addItem( QString::number( 25 << i ) + "%" );
|
||||
m_zoomingXModel.addItem( QString::number( 25 << i ) + "%" );
|
||||
}
|
||||
zoom_x_model->setValue( zoom_x_model->findText( "100%" ) );
|
||||
m_zoomingXModel.setValue( m_zoomingXModel.findText( "100%" ) );
|
||||
|
||||
m_zoomingXComboBox->setModel( zoom_x_model );
|
||||
m_zoomingXComboBox->setModel( &m_zoomingXModel );
|
||||
|
||||
connect( m_zoomingXComboBox, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( zoomingXChanged( const QString & ) ) );
|
||||
connect( &m_zoomingXModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( zoomingXChanged() ) );
|
||||
|
||||
|
||||
QLabel * zoom_y_lbl = new QLabel( m_toolBar );
|
||||
@@ -284,18 +287,17 @@ automationEditor::automationEditor( void ) :
|
||||
m_zoomingYComboBox = new comboBox( m_toolBar );
|
||||
m_zoomingYComboBox->setFixedSize( 80, 22 );
|
||||
|
||||
comboBoxModel * zoom_y_model = new comboBoxModel( /* this */ );
|
||||
zoom_y_model->addItem( "Auto" );
|
||||
m_zoomingYModel.addItem( "Auto" );
|
||||
for( int i = 0; i < 6; ++i )
|
||||
{
|
||||
zoom_y_model->addItem( QString::number( 25 << i ) + "%" );
|
||||
m_zoomingYModel.addItem( QString::number( 25 << i ) + "%" );
|
||||
}
|
||||
zoom_y_model->setValue( zoom_y_model->findText( "Auto" ) );
|
||||
m_zoomingYModel.setValue( m_zoomingYModel.findText( "Auto" ) );
|
||||
|
||||
m_zoomingYComboBox->setModel( zoom_y_model );
|
||||
m_zoomingYComboBox->setModel( &m_zoomingYModel );
|
||||
|
||||
connect( m_zoomingYComboBox, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( zoomingYChanged( const QString & ) ) );
|
||||
connect( &m_zoomingYModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( zoomingYChanged() ) );
|
||||
|
||||
|
||||
// setup quantize-stuff
|
||||
@@ -1996,9 +1998,10 @@ void automationEditor::updatePosition( const midiTime & _t )
|
||||
|
||||
|
||||
|
||||
void automationEditor::zoomingXChanged( const QString & _zfac )
|
||||
void automationEditor::zoomingXChanged( void )
|
||||
{
|
||||
m_ppt = _zfac.left( _zfac.length() - 1 ).toInt() * DEFAULT_PPT / 100;
|
||||
const QString & zfac = m_zoomingXModel.currentText();
|
||||
m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PPT / 100;
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( m_ppt > 0 );
|
||||
#endif
|
||||
@@ -2009,12 +2012,13 @@ void automationEditor::zoomingXChanged( const QString & _zfac )
|
||||
|
||||
|
||||
|
||||
void automationEditor::zoomingYChanged( const QString & _zfac )
|
||||
void automationEditor::zoomingYChanged( void )
|
||||
{
|
||||
m_y_auto = _zfac == "Auto";
|
||||
const QString & zfac = m_zoomingYModel.currentText();
|
||||
m_y_auto = zfac == "Auto";
|
||||
if( !m_y_auto )
|
||||
{
|
||||
m_y_delta = _zfac.left( _zfac.length() - 1 ).toInt()
|
||||
m_y_delta = zfac.left( zfac.length() - 1 ).toInt()
|
||||
* DEFAULT_Y_DELTA / 100;
|
||||
}
|
||||
#ifdef LMMS_DEBUG
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "automatable_model_templates.h"
|
||||
#include "clipboard.h"
|
||||
#include "combobox.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
|
||||
|
||||
#include "automation_track.h"
|
||||
#include "automatable_model_templates.h"
|
||||
#include "automation_editor.h"
|
||||
#include "bb_editor.h"
|
||||
#include "bb_track.h"
|
||||
#include "config_mgr.h"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <QtGui/QStyleOption>
|
||||
|
||||
|
||||
//#include "automation_pattern.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "automation_track.h"
|
||||
#include "bb_editor.h"
|
||||
#include "bb_track.h"
|
||||
|
||||
Reference in New Issue
Block a user