23 #include "lv_songinfo.h"
24 #include "lv_common.h"
25 #include "lv_libvisual.h"
29 SongInfo::SongInfo (SongInfoType type)
37 SongInfo::~SongInfo ()
42 void SongInfo::set_type (SongInfoType type)
47 SongInfoType SongInfo::get_type ()
const
52 void SongInfo::set_length (
int length)
57 int SongInfo::get_length ()
const
62 void SongInfo::set_elapsed (
int elapsed)
67 int SongInfo::get_elapsed ()
const
72 void SongInfo::set_simple_name (std::string
const& name)
77 std::string SongInfo::get_simple_name ()
const
82 void SongInfo::set_artist (std::string
const& artist)
87 std::string SongInfo::get_artist ()
const
92 void SongInfo::set_album (std::string
const& album)
97 std::string SongInfo::get_album ()
const
102 void SongInfo::set_song (std::string
const& song)
107 std::string SongInfo::get_song ()
const
116 auto xparam = system_params.
get (
"songinfo-cover-width");
117 auto yparam = system_params.get (
"songinfo-cover-height");
119 int cover_width = 64;
120 int cover_height = 64;
122 if (xparam && yparam) {
123 cover_width = visual_param_get_value_integer (xparam);
124 cover_height = visual_param_get_value_integer (yparam);
128 m_cover = Video::create_scale_depth (cover, cover_width, cover_height,
133 void SongInfo::mark ()
138 long SongInfo::get_age ()
140 auto cur = Time::now ();
141 auto start_time = m_timer.get_start_time ();
144 if (cur < start_time)
154 if (lhs.m_song_name != rhs.m_song_name)
157 if (lhs.m_artist != rhs.m_artist)
160 if (lhs.m_album != rhs.m_album)
163 if (lhs.m_song != rhs.m_song)