libsaria: Remove operator[] for int values

Public access to these variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-11-24 17:01:49 -05:00 committed by Anna Schumaker
parent 56dd54f114
commit 29718ceb12
3 changed files with 1 additions and 23 deletions

View File

@ -29,13 +29,6 @@ enum track_uiprop_t {
TRACK_LAST_YEAR,
};
enum track_iprop_t {
TRACK_LENGTH,
TRACK_BITRATE,
TRACK_SAMPLE,
TRACK_CHANNELS,
};
namespace libsaria
{
namespace library
@ -97,7 +90,6 @@ namespace libsaria
bool operator<(Track &);
string &operator[](track_sprop_t);
unsigned int &operator[](track_uiprop_t);
int &operator[](track_iprop_t);
};
Track *current_track();

View File

@ -77,7 +77,7 @@ namespace libsaria
{
unsigned int res = 0;
for (unsigned int i = 0; i < plist.size(); i++)
res += (*plist[i])[TRACK_LENGTH];
res += plist[i]->length;
return res;
}

View File

@ -86,18 +86,4 @@ namespace libsaria
}
}
int &Track::operator[](track_iprop_t property)
{
switch (property) {
case TRACK_LENGTH:
return length;
case TRACK_BITRATE:
return bitrate;
case TRACK_SAMPLE:
return sample;
default: /* TRACK_CHANNELS */
return channels;
}
}
}