summaryrefslogtreecommitdiffstats
path: root/src/djinterop/impl/track_impl.hpp
blob: 2279a785086d54dcac36d581fc6dd07769d6e77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
    This file is part of libdjinterop.

    libdjinterop is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    libdjinterop is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with libdjinterop.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include <chrono>
#include <string>
#include <vector>

#include <boost/optional.hpp>

#include <djinterop/performance_data.hpp>

namespace djinterop
{
class database;
class track;
struct track_import_info;
enum class musical_key;

class track_impl
{
public:
    track_impl(int64_t id) noexcept;
    virtual ~track_impl() noexcept;

    int64_t id() noexcept;

    virtual std::vector<beatgrid_marker> adjusted_beatgrid() = 0;
    virtual void set_adjusted_beatgrid(
        std::vector<beatgrid_marker> beatgrid) = 0;
    virtual double adjusted_main_cue() = 0;
    virtual void set_adjusted_main_cue(double sample_offset) = 0;
    virtual boost::optional<std::string> album() = 0;
    virtual void set_album(boost::optional<std::string> album) = 0;
    virtual boost::optional<int64_t> album_art_id() = 0;
    virtual void set_album_art_id(boost::optional<int64_t> album_art_id) = 0;
    virtual boost::optional<std::string> artist() = 0;
    virtual void set_artist(boost::optional<std::string> artist) = 0;
    virtual boost::optional<double> average_loudness() = 0;
    virtual void set_average_loudness(
        boost::optional<double> average_loudness) = 0;
    virtual boost::optional<int64_t> bitrate() = 0;
    virtual void set_bitrate(boost::optional<int64_t> bitrate) = 0;
    virtual boost::optional<double> bpm() = 0;
    virtual void set_bpm(boost::optional<double> bpm) = 0;
    virtual boost::optional<std::string> comment() = 0;
    virtual void set_comment(boost::optional<std::string> comment) = 0;
    virtual boost::optional<std::string> composer() = 0;
    virtual void set_composer(boost::optional<std::string> composer) = 0;
    virtual std::vector<crate> containing_crates() = 0;
    virtual database db() = 0;
    virtual std::vector<beatgrid_marker> default_beatgrid() = 0;
    virtual void set_default_beatgrid(
        std::vector<beatgrid_marker> beatgrid) = 0;
    virtual double default_main_cue() = 0;
    virtual void set_default_main_cue(double sample_offset) = 0;
    virtual boost::optional<std::chrono::milliseconds> duration() = 0;
    virtual std::string file_extension() = 0;
    virtual std::string filename() = 0;
    virtual boost::optional<std::string> genre() = 0;
    virtual void set_genre(boost::optional<std::string> genre) = 0;
    virtual boost::optional<hot_cue> hot_cue_at(int32_t index) = 0;
    virtual void set_hot_cue_at(
        int32_t index, boost::optional<hot_cue> cue) = 0;
    virtual std::array<boost::optional<hot_cue>, 8> hot_cues() = 0;
    virtual void set_hot_cues(std::array<boost::optional<hot_cue>, 8> cues) = 0;
    virtual boost::optional<track_import_info> import_info() = 0;
    virtual void set_import_info(
        const boost::optional<track_import_info>& import_info) = 0;
    virtual bool is_valid() = 0;
    virtual boost::optional<musical_key> key() = 0;
    virtual void set_key(boost::optional<musical_key> key) = 0;
    virtual boost::optional<std::chrono::system_clock::time_point>
    last_accessed_at() = 0;
    virtual void set_last_accessed_at(
        boost::optional<std::chrono::system_clock::time_point>
            last_accessed_at) = 0;
    virtual boost::optional<std::chrono::system_clock::time_point>
    last_modified_at() = 0;
    virtual void set_last_modified_at(
        boost::optional<std::chrono::system_clock::time_point>
            last_modified_at) = 0;
    virtual boost::optional<std::chrono::system_clock::time_point>
    last_played_at() = 0;
    virtual void set_last_played_at(
        boost::optional<std::chrono::system_clock::time_point> time) = 0;
    virtual boost::optional<loop> loop_at(int32_t index) = 0;
    virtual void set_loop_at(int32_t index, boost::optional<loop> l) = 0;
    virtual std::array<boost::optional<loop>, 8> loops() = 0;
    virtual void set_loops(std::array<boost::optional<loop>, 8> loops) = 0;
    virtual std::vector<waveform_entry> overview_waveform() = 0;
    virtual boost::optional<std::string> publisher() = 0;
    virtual void set_publisher(boost::optional<std::string> publisher) = 0;
    virtual int64_t required_waveform_samples_per_entry() = 0;
    virtual std::string relative_path() = 0;
    virtual void set_relative_path(std::string relative_path) = 0;
    virtual boost::optional<sampling_info> sampling() = 0;
    virtual void set_sampling(boost::optional<sampling_info> sample_rate) = 0;
    virtual boost::optional<std::string> title() = 0;
    virtual void set_title(boost::optional<std::string> title) = 0;
    virtual boost::optional<int32_t> track_number() = 0;
    virtual void set_track_number(boost::optional<int32_t> track_number) = 0;
    virtual std::vector<waveform_entry> waveform() = 0;
    virtual void set_waveform(std::vector<waveform_entry> waveform) = 0;
    virtual boost::optional<int32_t> year() = 0;
    virtual void set_year(boost::optional<int32_t> year) = 0;

private:
    int64_t id_;
};

}  // namespace djinterop