| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
#include "playbacktoolbarcustomiseitem.h" |
| 5 |
|
| 6 |
using namespace au::playback; |
| 7 |
using namespace muse::uicomponents; |
| 8 |
|
| 9 |
PlaybackToolBarCustomiseItem::PlaybackToolBarCustomiseItem(const ItemType& type, QObject* parent) |
| 10 |
: SelectableItemListModel::Item(parent), m_type(type) |
| 11 |
{ |
| 12 |
} |
| 13 |
|
| 14 |
QString PlaybackToolBarCustomiseItem::id() const |
| 15 |
{ |
| 16 |
return m_id; |
| 17 |
} |
| 18 |
|
| 19 |
QString PlaybackToolBarCustomiseItem::title() const |
| 20 |
{ |
| 21 |
return m_title; |
| 22 |
} |
| 23 |
|
| 24 |
PlaybackToolBarCustomiseItem::ItemType PlaybackToolBarCustomiseItem::type() const |
| 25 |
{ |
| 26 |
return m_type; |
| 27 |
} |
| 28 |
|
| 29 |
void PlaybackToolBarCustomiseItem::setTitle(QString title) |
| 30 |
{ |
| 31 |
if (m_title == title) { |
| 32 |
return; |
| 33 |
} |
| 34 |
|
| 35 |
m_title = title; |
| 36 |
emit titleChanged(); |
| 37 |
} |
| 38 |
|
| 39 |
void PlaybackToolBarCustomiseItem::setId(const QString& id) |
| 40 |
{ |
| 41 |
m_id = id; |
| 42 |
} |
| 43 |
|
| 44 |
int PlaybackToolBarCustomiseItem::icon() const |
| 45 |
{ |
| 46 |
return static_cast<int>(m_icon); |
| 47 |
} |
| 48 |
|
| 49 |
bool PlaybackToolBarCustomiseItem::checked() const |
| 50 |
{ |
| 51 |
return m_checked; |
| 52 |
} |
| 53 |
|
| 54 |
void PlaybackToolBarCustomiseItem::setIcon(muse::ui::IconCode::Code icon) |
| 55 |
{ |
| 56 |
if (m_icon == icon) { |
| 57 |
return; |
| 58 |
} |
| 59 |
|
| 60 |
m_icon = icon; |
| 61 |
emit iconChanged(); |
| 62 |
} |
| 63 |
|
| 64 |
void PlaybackToolBarCustomiseItem::setChecked(bool checked) |
| 65 |
{ |
| 66 |
if (m_checked == checked) { |
| 67 |
return; |
| 68 |
} |
| 69 |
|
| 70 |
m_checked = checked; |
| 71 |
emit checkedChanged(m_checked); |
| 72 |
} |