1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright 2012 Canonical Ltd.
5
* This program is free software: you can redistribute it and/or modify it
6
* under the terms of the GNU Lesser General Public License version 3, as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranties of
11
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12
* PURPOSE. See the applicable version of the GNU Lesser General Public
13
* License for more details.
15
* You should have received a copy of both the GNU Lesser General Public
16
* License version 3 along with this program. If not, see
17
* <http://www.gnu.org/licenses/>
19
* Authored by: Nick Dedekind <nick.dedekind@canonical.com>
27
#include <Nux/ScrollView.h>
28
#include <UnityCore/Tracks.h>
29
#include "unity-shared/Introspectable.h"
42
class Tracks : public nux::ScrollView, public debug::Introspectable
45
typedef nux::ObjectPtr<Tracks> Ptr;
46
NUX_DECLARE_OBJECT_TYPE(Tracks, nux::View);
48
Tracks(dash::Tracks::Ptr tracks, NUX_FILE_LINE_PROTO);
51
// From debug::Introspectable
52
std::string GetName() const;
53
void AddProperties(GVariantBuilder* builder);
55
sigc::signal<void, std::string const&> play;
56
sigc::signal<void, std::string const&> pause;
59
virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw);
60
virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw);
64
void OnTrackUpdated(dash::Track const& track);
65
void OnTrackAdded(dash::Track const& track);
66
void OnTrackRemoved(dash::Track const&track);
68
void onPlayTrack(std::string const& uri);
69
void onPauseTrack(std::string const& uri);
72
dash::Tracks::Ptr tracks_;
75
std::map<std::string, previews::Track::Ptr> m_tracks;