A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 101 lines 2.9 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2005 Miika Pekkarinen 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21 22#ifndef _PLAYBACK_H 23#define _PLAYBACK_H 24 25#include <stdbool.h> 26#include <stdlib.h> 27#include "config.h" 28 29/* Including the code for fast previews is entirely optional since it 30 does add two more mp3entry's - for certain targets it may be less 31 beneficial such as flash-only storage */ 32#if MEMORYSIZE > 2 33#define AUDIO_FAST_SKIP_PREVIEW 34#endif 35 36#ifdef HAVE_ALBUMART 37 38#include "bmp.h" 39#include "metadata.h" 40/* 41 * Returns the handle id of the buffered albumart for the given slot id 42 **/ 43int playback_current_aa_hid(int slot); 44 45/* 46 * Hands out an albumart slot for buffering albumart using the size 47 * int the passed dim struct, it copies the data of dim in order to 48 * be safe to be reused for other code 49 * 50 * The slot may be reused if other code calls this with the same dimensions 51 * in dim, so if you change dim release and claim a new slot 52 * 53 * Save to call from other threads */ 54int playback_claim_aa_slot(struct dim *dim); 55 56/* 57 * Releases the albumart slot with given id 58 * 59 * Save to call from other threads */ 60void playback_release_aa_slot(int slot); 61 62/* 63 * Tells playback to sync buffered album art dimensions 64 * 65 * Save to call from other threads */ 66void playback_update_aa_dims(void); 67 68struct bufopen_bitmap_data { 69 struct dim *dim; 70 struct mp3_albumart *embedded_albumart; 71}; 72 73#endif /* HAVE_ALBUMART */ 74 75/* Functions */ 76unsigned int audio_track_count(void); 77long audio_filebufused(void); 78void audio_pre_ff_rewind(void); 79void audio_skip(int direction); 80 81void audio_set_cuesheet(bool enable); 82#ifdef HAVE_CROSSFADE 83void audio_set_crossfade(int enable); 84#endif 85#ifdef HAVE_PLAY_FREQ 86void audio_set_playback_frequency(unsigned int sample_rate_hz); 87#endif 88#ifdef HAVE_ALBUMART 89void set_albumart_mode(int setting); 90#endif 91 92size_t audio_get_filebuflen(void); 93 94unsigned int playback_status(void); 95 96struct mp3entry* get_temp_mp3entry(struct mp3entry *free); 97 98void allocate_playback_log(void); 99void add_playbacklog(struct mp3entry *id3); 100 101#endif /* _PLAYBACK_H */