foobar2000 SDK  2015-01-14
playable_location.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 int playable_location::g_compare(const playable_location & p_item1,const playable_location & p_item2) {
4  int ret = metadb::path_compare(p_item1.get_path(),p_item2.get_path());
5  if (ret != 0) return ret;
6  return pfc::compare_t(p_item1.get_subsong(),p_item2.get_subsong());
7 }
8 
9 bool playable_location::g_equals( const playable_location & p_item1, const playable_location & p_item2) {
10  return g_compare(p_item1, p_item2) == 0;
11 }
12 
14 {
15  p_fmt << "\"" << file_path_display(p_location.get_path()) << "\"";
16  t_uint32 index = p_location.get_subsong_index();
17  if (index != 0) p_fmt << " / index: " << p_location.get_subsong_index();
18  return p_fmt;
19 }
20 
21 
22 bool playable_location::operator==(const playable_location & p_other) const {
23  return metadb::path_compare(get_path(),p_other.get_path()) == 0 && get_subsong() == p_other.get_subsong();
24 }
25 bool playable_location::operator!=(const playable_location & p_other) const {
26  return !(*this == p_other);
27 }
virtual t_uint32 get_subsong() const =0
virtual const char * get_path() const =0
static bool g_equals(const playable_location &p_item1, const playable_location &p_item2)
bool operator!=(const playable_location &p_other) const
int compare_t(const hasher_md5_result &p_item1, const hasher_md5_result &p_item2)
Definition: hasher_md5.h:20
static int path_compare(const char *p1, const char *p2)
Definition: metadb.h:245
t_uint32 get_subsong_index() const
pfc::string_base & operator<<(pfc::string_base &p_fmt, const playable_location &p_location)
static int g_compare(const playable_location &p_item1, const playable_location &p_item2)
uint32_t t_uint32
Definition: int_types.h:5
bool operator==(const playable_location &p_other) const