From 4f44b9423090b9df9b79cc9875af2c5edcd72c9c Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 18 Jul 2008 10:03:19 +0000 Subject: [PATCH] * moved name_label.* to track_label_button.* * bigger icons for trackLabelButtons git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1320 0778d3d1-df1d-0410-868b-ea421aaaa00d --- Makefile.am | 6 +++--- include/track_label_button.h | 6 +++--- src/gui/widgets/track_label_button.cpp | 9 +++++---- src/tracks/automation_track.cpp | 4 ++-- src/tracks/bb_track.cpp | 2 +- src/tracks/instrument_track.cpp | 2 +- src/tracks/pattern.cpp | 22 +++++++++++----------- src/tracks/sample_track.cpp | 4 +--- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Makefile.am b/Makefile.am index f0bf7d2b4..35e21ca23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,7 +132,7 @@ lmms_MOC = \ ./midi_port_menu.moc \ ./mixer.moc \ ./mv_base.moc \ - ./name_label.moc \ + ./track_label_button.moc \ ./nstate_button.moc \ ./pattern.moc \ ./peak_controller.moc \ @@ -315,7 +315,7 @@ lmms_SOURCES = \ $(srcdir)/src/gui/widgets/led_checkbox.cpp \ $(srcdir)/src/gui/widgets/meter_dialog.cpp \ $(srcdir)/src/gui/widgets/midi_port_menu.cpp \ - $(srcdir)/src/gui/widgets/name_label.cpp \ + $(srcdir)/src/gui/widgets/track_label_button.cpp \ $(srcdir)/src/gui/widgets/nstate_button.cpp \ $(srcdir)/src/gui/widgets/pixmap_button.cpp \ $(srcdir)/src/gui/widgets/project_notes.cpp \ @@ -413,7 +413,7 @@ lmms_SOURCES = \ $(srcdir)/include/caption_menu.h \ $(srcdir)/include/sample_track.h \ $(srcdir)/include/sample_buffer.h \ - $(srcdir)/include/name_label.h \ + $(srcdir)/include/track_label_button.h \ $(srcdir)/include/play_handle.h \ $(srcdir)/include/mmp.h \ $(srcdir)/include/midi.h \ diff --git a/include/track_label_button.h b/include/track_label_button.h index 8696419a4..ccced5ae6 100644 --- a/include/track_label_button.h +++ b/include/track_label_button.h @@ -1,5 +1,5 @@ /* - * name_label.h - class trackLabelButton + * track_label_button.h - class trackLabelButton * * Copyright (c) 2004-2008 Tobias Doerffel * @@ -23,8 +23,8 @@ */ -#ifndef _NAME_LABEL_H -#define _NAME_LABEL_H +#ifndef _TRACK_LABEL_BUTTON_H +#define _TRACK_LABEL_BUTTON_H #include diff --git a/src/gui/widgets/track_label_button.cpp b/src/gui/widgets/track_label_button.cpp index ddfff72b1..465f4b695 100644 --- a/src/gui/widgets/track_label_button.cpp +++ b/src/gui/widgets/track_label_button.cpp @@ -1,8 +1,8 @@ #ifndef SINGLE_SOURCE_COMPILE /* - * name_label.cpp - implementation of class trackLabelButton, a label which - * is renamable by double-clicking it + * track_label_button.cpp - implementation of class trackLabelButton, a label + * which is renamable by double-clicking it * * Copyright (c) 2004-2008 Tobias Doerffel * @@ -33,7 +33,7 @@ #include -#include "name_label.h" +#include "track_label_button.h" #include "embed.h" #include "rename_dialog.h" #include "bb_track_container.h" @@ -54,6 +54,7 @@ trackLabelButton::trackLabelButton( trackView * _tv, QWidget * _parent ) : setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) ); setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); setFixedSize( 160, 29 ); + setIconSize( QSize( 32, 32 ) ); updateName(); connect( m_trackView->getTrack(), SIGNAL( dataChanged() ), @@ -233,7 +234,7 @@ void trackLabelButton::dropEvent( QDropEvent * _de ) -#include "name_label.moc" +#include "track_label_button.moc" #endif diff --git a/src/tracks/automation_track.cpp b/src/tracks/automation_track.cpp index bb402d22a..111de4699 100644 --- a/src/tracks/automation_track.cpp +++ b/src/tracks/automation_track.cpp @@ -30,10 +30,10 @@ #include "automation_track.h" #include "automation_pattern.h" #include "embed.h" -#include "name_label.h" -#include "string_pair_drag.h" #include "project_journal.h" +#include "string_pair_drag.h" #include "track_container_view.h" +#include "track_label_button.h" automationTrack::automationTrack( trackContainer * _tc, bool _hidden ) : diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index b19555b1b..b6d899b8d 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -38,11 +38,11 @@ #include "engine.h" #include "gui_templates.h" #include "mixer.h" -#include "name_label.h" #include "rename_dialog.h" #include "song.h" #include "song_editor.h" #include "templates.h" +#include "track_label_button.h" diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 1fc3811ad..cabbcc043 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -67,7 +67,6 @@ #include "main_window.h" #include "midi_client.h" #include "midi_port_menu.h" -#include "name_label.h" #include "mmp.h" #include "note_play_handle.h" #include "pattern.h" @@ -78,6 +77,7 @@ #include "surround_area.h" #include "tab_widget.h" #include "tooltip.h" +#include "track_label_button.h" diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 60eb9586a..c3df6a48c 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -1049,7 +1049,7 @@ void patternView::wheelEvent( QWheelEvent * _we ) return; } note * n = m_pat->m_notes[step]; - Uint8 vol = n->getVolume(); + int vol = n->getVolume(); if( n->length() == 0 && _we->delta() > 0 ) { @@ -1164,7 +1164,7 @@ void patternView::paintEvent( QPaintEvent * ) { central_key = central_key / total_notes; - int central_y = height() / 2; + const int central_y = height() / 2; int y_base = central_y + TCO_BORDER_WIDTH -1; if( m_pat->getTrack()->isMuted() || @@ -1185,17 +1185,17 @@ void patternView::paintEvent( QPaintEvent * ) m_pat->m_notes.begin(); it != m_pat->m_notes.end(); ++it ) { - Sint8 y_pos = central_key - + const int y_pos = central_key - ( *it )->key(); if( ( *it )->length() > 0 && y_pos > -central_y && y_pos < central_y ) { - int x1 = 2 * x_base + + const int x1 = 2 * x_base + static_cast( ( *it )->pos() * ppt / midiTime::ticksPerTact() ); - int x2 = + const int x2 = static_cast( ( ( *it )->pos() + ( *it )->length() ) * ppt / midiTime::ticksPerTact() ); p.drawLine( x1, y_base + y_pos, x2, y_base + y_pos ); @@ -1234,13 +1234,13 @@ void patternView::paintEvent( QPaintEvent * ) for( noteVector::iterator it = m_pat->m_notes.begin(); it != m_pat->m_notes.end(); ++it ) { - int no = ( *it )->pos() / DefaultBeatsPerTact; - int x = TCO_BORDER_WIDTH + static_cast( no * + const int no = ( *it )->pos() / DefaultBeatsPerTact; + const int x = TCO_BORDER_WIDTH + static_cast( no * w / steps ); - int y = height() - s_stepBtnOff->height() - 1; - - Uint8 vol = ( *it )->getVolume(); - + const int y = height() - s_stepBtnOff->height() - 1; + + const int vol = ( *it )->getVolume(); + if( ( *it )->length() < 0 ) { p.drawPixmap( x, y, stepoff ); diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index ab2302a03..644f00bf3 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -33,20 +33,18 @@ #include #include -#include "name_label.h" #include "sample_track.h" #include "song.h" #include "embed.h" #include "engine.h" -#include "templates.h" #include "tooltip.h" #include "audio_port.h" -#include "automation_pattern.h" #include "sample_play_handle.h" #include "string_pair_drag.h" #include "knob.h" #include "main_window.h" #include "effect_rack_view.h" +#include "track_label_button.h"