2414.1.9
by Michal Hruby
Implement MusicPreview |
1 |
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
|
2 |
/*
|
|
3 |
* Copyright (C) 2011 Canonical Ltd
|
|
4 |
*
|
|
5 |
* This program is free software: you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License version 3 as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16 |
*
|
|
17 |
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
|
|
18 |
*/
|
|
19 |
||
20 |
#ifndef UNITY_TRACK_H
|
|
21 |
#define UNITY_TRACK_H
|
|
22 |
||
23 |
#include <NuxCore/Property.h> |
|
24 |
||
25 |
#include "ModelRowAdaptor.h" |
|
26 |
||
27 |
namespace unity |
|
28 |
{
|
|
29 |
namespace dash |
|
30 |
{
|
|
31 |
||
32 |
/* This class represents a DeeModelIter for a TracksModel
|
|
33 |
* It's slightly chunky, but that is because it's optimized to be stack-allocated
|
|
34 |
* as it is not expected to be kept by the views, rather views can easily attach
|
|
35 |
* a "renderer" to the iter, so when the changed or removed signals are called,
|
|
36 |
* the view can easily find which widget/view belongs to this iter.
|
|
37 |
*/
|
|
38 |
class Track : public RowAdaptorBase |
|
39 |
{
|
|
40 |
public: |
|
41 |
Track(DeeModel* model, DeeModelIter* iter, DeeModelTag* tag); |
|
42 |
||
43 |
Track(Track const& other); |
|
44 |
Track& operator=(Track const& other); |
|
45 |
||
46 |
nux::ROProperty<std::string> uri; |
|
47 |
nux::ROProperty<int> track_number; |
|
48 |
nux::ROProperty<std::string> title; |
|
49 |
nux::ROProperty<unsigned> length; |
|
3008.2.59
by Nick Dedekind
Added track index |
50 |
nux::ROProperty<std::size_t> index; |
2414.1.9
by Michal Hruby
Implement MusicPreview |
51 |
|
52 |
private: |
|
53 |
void SetupGetters(); |
|
3008.2.59
by Nick Dedekind
Added track index |
54 |
std::size_t get_index() const; |
2414.1.9
by Michal Hruby
Implement MusicPreview |
55 |
};
|
56 |
||
57 |
}
|
|
58 |
}
|
|
59 |
||
60 |
#endif
|