Add classic-TCO back, enhance song editor, cleanup code
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@2059 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -66,6 +66,9 @@ public:
|
||||
|
||||
virtual QColor color(LmmsStyle::ColorRole _role) const;
|
||||
|
||||
virtual void drawTrackContentObject( QPainter * _painter, const trackContentObject * _model,
|
||||
const LmmsStyleOptionTCO * _options );
|
||||
|
||||
private:
|
||||
QImage colorizeXpm( const char * const * xpm, const QBrush & fill ) const;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* combobox.h - class comboBox, a very cool combo-box
|
||||
*
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2009 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -68,6 +68,9 @@ public:
|
||||
virtual void drawTrackContentBackground( QPainter * _painter,
|
||||
const QSize & _size, const int _pixelsPerTact );
|
||||
|
||||
virtual void drawTrackContentObject( QPainter * _painter, const trackContentObject * _model,
|
||||
const LmmsStyleOptionTCO * _options );
|
||||
|
||||
virtual QColor color( LmmsStyle::ColorRole _role ) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -19,17 +19,17 @@ class BbTrackContentObjectItem : public TrackContentObjectItem
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BbTrackContentObjectItem( TrackItem * _track, trackContentObject * _object );
|
||||
BbTrackContentObjectItem( TrackItem * _track, trackContentObject * _object );
|
||||
|
||||
void paint( QPainter * _painter, const QStyleOptionGraphicsItem * _option,
|
||||
QWidget * _widget );
|
||||
|
||||
QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
virtual void paint( QPainter * _painter, const QStyleOptionGraphicsItem * _option,
|
||||
QWidget * _widget );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -10,27 +10,26 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "gui/tracks/track_content_object_item.h"
|
||||
#include "gui/tracks/track_item.h"
|
||||
|
||||
class trackContentObject;
|
||||
class TrackItem;
|
||||
|
||||
class PatternItem : public TrackContentObjectItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PatternItem( TrackItem * _track, trackContentObject * _object );
|
||||
PatternItem( TrackItem * _track, trackContentObject * _object );
|
||||
|
||||
void paint( QPainter * _painter, const QStyleOptionGraphicsItem * _option,
|
||||
virtual void paint( QPainter * _painter, const QStyleOptionGraphicsItem * _option,
|
||||
QWidget * _widget );
|
||||
|
||||
QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
|
||||
// virtual QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _TRACK_CONTAINER_SCENE_H
|
||||
#define _TRACK_CONTAINER_SCENE_H
|
||||
|
||||
@@ -103,12 +104,6 @@ protected:
|
||||
virtual void keyPressEvent( QKeyEvent * event );
|
||||
|
||||
private:
|
||||
/*
|
||||
enum Actions
|
||||
{
|
||||
AddTrack,
|
||||
RemoveTrack
|
||||
} ;*/
|
||||
|
||||
|
||||
//signals:
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <QPainter>
|
||||
#include <math.h>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
|
||||
class trackContentObject;
|
||||
class TrackItem;
|
||||
|
||||
@@ -19,47 +21,53 @@ class TrackContentObjectItem : public QObject, public QGraphicsItem
|
||||
friend class TrackContainerScene;
|
||||
|
||||
public:
|
||||
TrackContentObjectItem( TrackItem * _track, trackContentObject * _object );
|
||||
TrackContentObjectItem( TrackItem * _track, trackContentObject * _object );
|
||||
|
||||
virtual ~TrackContentObjectItem()
|
||||
{
|
||||
if( m_snapBackAnimation != NULL )
|
||||
{
|
||||
delete m_snapBackAnimation;
|
||||
}
|
||||
};
|
||||
virtual ~TrackContentObjectItem()
|
||||
{
|
||||
if( m_snapBackAnimation != NULL )
|
||||
{
|
||||
delete m_snapBackAnimation;
|
||||
}
|
||||
};
|
||||
|
||||
QRectF boundingRect() const;
|
||||
|
||||
void paint( QPainter * _painter, const QStyleOptionGraphicsItem * _option,
|
||||
QWidget * _widget );
|
||||
|
||||
QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
QWidget * _widget );
|
||||
|
||||
|
||||
virtual qreal zValue() const;
|
||||
virtual qreal zValue() const;
|
||||
|
||||
// For TrackItem to call
|
||||
void updateGeometry();
|
||||
// For TrackItem to call
|
||||
void updateGeometry();
|
||||
|
||||
protected:
|
||||
void prepareSnapBackAnimation( QTimeLine * timeLine );
|
||||
void prepareSnapBackAnimation( QTimeLine * timeLine, int newX );
|
||||
virtual QVariant itemChange( GraphicsItemChange _change, const QVariant & _value );
|
||||
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent * event );
|
||||
virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent * event );
|
||||
|
||||
void prepareSnapBackAnimation( QTimeLine * timeLine );
|
||||
void prepareSnapBackAnimation( QTimeLine * timeLine, int newX );
|
||||
|
||||
protected slots:
|
||||
void updateLength( void );
|
||||
void updatePosition( void );
|
||||
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
|
||||
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent * event );
|
||||
virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent * event );
|
||||
|
||||
protected:
|
||||
QPointF m_lastPos;
|
||||
QPointF m_lastDest;
|
||||
QGraphicsItemAnimation * m_snapBackAnimation;
|
||||
static QTimeLine s_snapBackTimeLine;
|
||||
tact m_length;
|
||||
QGraphicsItemAnimation * m_snapBackAnimation;
|
||||
static QTimeLine s_snapBackTimeLine;
|
||||
|
||||
TrackItem * m_trackItem;
|
||||
trackContentObject * m_tco;
|
||||
bool m_hover;
|
||||
bool m_hover;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
/*
|
||||
* track_item.h
|
||||
*
|
||||
* Created on: Jan 27, 2009
|
||||
* Author: llama
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TRACK_ITEM_H_
|
||||
#define TRACK_ITEM_H_
|
||||
@@ -44,4 +39,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif /* TRACK_ITEM_H_ */
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2009 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -28,8 +28,17 @@
|
||||
#define _LMMS_STYLE_H
|
||||
|
||||
|
||||
// Defines for widgets
|
||||
#include "fx_mixer_view.h"
|
||||
#include <QColor>
|
||||
#include <QRect>
|
||||
#include "lmms_basics.h"
|
||||
|
||||
class QPainter;
|
||||
class QSize;
|
||||
class QString;
|
||||
class QWidget;
|
||||
|
||||
class LmmsStyleOptionTCO;
|
||||
class trackContentObject;
|
||||
|
||||
|
||||
class LmmsStyle
|
||||
@@ -87,8 +96,32 @@ public:
|
||||
virtual void drawTrackContentBackground(QPainter * _painter,
|
||||
const QSize & _size, const int _pixelsPerTact) = 0;
|
||||
|
||||
virtual void drawTrackContentObject( QPainter * _painter, const trackContentObject * _model,
|
||||
const LmmsStyleOptionTCO * _options ) = 0;
|
||||
|
||||
virtual QColor color(ColorRole _role) const = 0;
|
||||
|
||||
} ;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class LmmsStyleOptionTCO
|
||||
{
|
||||
public:
|
||||
enum TcoTypes
|
||||
{
|
||||
BbTco,
|
||||
Pattern,
|
||||
NumTcoTypes
|
||||
};
|
||||
TcoTypes type;
|
||||
|
||||
QRectF rect;
|
||||
bool selected;
|
||||
bool hovered;
|
||||
QColor userColor;
|
||||
tick duration;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
void rearrangeAllNotes( void );
|
||||
void clearNotes( void );
|
||||
|
||||
inline const noteVector & notes( void )
|
||||
inline const noteVector & notes( void ) const
|
||||
{
|
||||
return m_notes;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
return "pattern";
|
||||
}
|
||||
|
||||
inline instrumentTrack * getInstrumentTrack( void )
|
||||
inline instrumentTrack * getInstrumentTrack( void ) const
|
||||
{
|
||||
return m_instrumentTrack;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
trackContentObject( track * _track );
|
||||
virtual ~trackContentObject();
|
||||
|
||||
inline track * getTrack( void )
|
||||
inline track * getTrack( void ) const
|
||||
{
|
||||
return( m_track );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user