return ret;
}
-
int attribute_align_arg mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val)
{
+#ifndef NO_EQUALIZER
if(mh == NULL) return MPG123_BAD_HANDLE;
if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; }
switch(channel)
return MPG123_ERR;
}
mh->have_eq_settings = TRUE;
+#endif
return MPG123_OK;
}
double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band)
{
double ret = 0.;
+#ifndef NO_EQUALIZER
/* Handle this gracefully. When there is no band, it has no volume. */
if(mh != NULL && band > -1 && band < 32)
case MPG123_RIGHT: ret = REAL_TO_DOUBLE(mh->equalizer[1][band]); break;
/* Default case is already handled: ret = 0 */
}
-
+#endif
return ret;
}
-
/* plain file access, no http! */
int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path)
{
return MPG123_OK;
}
+off_t attribute_align_arg mpg123_framelength(mpg123_handle *mh)
+{
+ int b;
+ if(mh == NULL)
+ return MPG123_ERR;
+ b = init_track(mh);
+ if(b<0)
+ return b;
+ if(mh->track_frames > 0)
+ return mh->track_frames;
+ if(mh->rdat.filelen > 0)
+ { /* A bad estimate. Ignoring tags 'n stuff. */
+ double bpf = mh->mean_framesize > 0.
+ ? mh->mean_framesize
+ : compute_bpf(mh);
+ return (off_t)((double)(mh->rdat.filelen)/bpf+0.5);
+ }
+ /* Last resort: No view of the future, can at least count the frames that
+ were already parsed. */
+ if(mh->num > -1)
+ return mh->num+1;
+ /* Giving up. */
+ return MPG123_ERR;
+}
+
off_t attribute_align_arg mpg123_length(mpg123_handle *mh)
{
int b;
return length;
}
+
int attribute_align_arg mpg123_scan(mpg123_handle *mh)
{
int b;