diff --git a/core/audio.cpp b/core/audio.cpp index 372871f5..8c8c6735 100644 --- a/core/audio.cpp +++ b/core/audio.cpp @@ -112,14 +112,14 @@ void audio :: stop() seek_to(0); } -long audio :: position() +int64_t audio :: position() { if (cur_track) return cur_driver->position(); return 0; } -long audio :: duration() +int64_t audio :: duration() { if (cur_track) return cur_driver->duration(); diff --git a/gui/gst.cpp b/gui/gst.cpp index 28d1898e..f2de2fde 100644 --- a/gui/gst.cpp +++ b/gui/gst.cpp @@ -105,9 +105,9 @@ public: offset); } - long position() + int64_t position() { - long position; + int64_t position; if (gst_element_query_position(gst_player, GST_FORMAT_TIME, &position)) @@ -115,9 +115,9 @@ public: return 0; } - long duration() + int64_t duration() { - long duration; + int64_t duration; if (gst_element_query_duration(gst_player, GST_FORMAT_TIME, &duration)) diff --git a/include/core/audio.h b/include/core/audio.h index fb8ac410..414f7f70 100644 --- a/include/core/audio.h +++ b/include/core/audio.h @@ -7,6 +7,7 @@ #include #include +#include /** @@ -59,14 +60,14 @@ public: * * @return The current playback position, in nanoseconds. */ - virtual long position() = 0; + virtual int64_t position() = 0; /** * Return the duration of the currently loaded track. * * @return The duration of the current track, in nanoseconds. */ - virtual long duration() = 0; + virtual int64_t duration() = 0; /** * Called to handle reaching the end-of-stream. @@ -100,12 +101,12 @@ namespace audio /** * @return The current position of the audio playback (in nanoseconds). */ - long position(); + int64_t position(); /** * @return The duration of the currently loaded track (in nanoseconds). */ - long duration(); + int64_t duration(); void next(); /**< Find and load the next track that should be played. */ void prev(); /**< Call the deck :: previous() function and load the result. */ diff --git a/tests/core/audio.cpp b/tests/core/audio.cpp index 2a5bef99..f8eb9954 100644 --- a/tests/core/audio.cpp +++ b/tests/core/audio.cpp @@ -13,8 +13,8 @@ class TestDriver : public AudioDriver { public: bool playing; - long cur_pos; - long cur_duration; + int64_t cur_pos; + int64_t cur_duration; std::string cur_file; TestDriver() : playing(false), cur_pos(0), cur_duration(0) {} @@ -33,8 +33,8 @@ public: bool is_playing() { return playing; } void seek_to(long offset) { cur_pos = offset; } - long position() { return cur_pos; } - long duration() { return cur_duration; } + int64_t position() { return cur_pos; } + int64_t duration() { return cur_duration; } };