Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
src/MPD/Client.hh
Go to the documentation of this file.
00001 /***********************************************************
00002 * This file is part of Freya
00003 * - A free MPD Gtk3 MPD Client -
00004 *
00005 * Authors: Christopher Pahl, Christoph Piechula,
00006 *          Eduard Schneider
00007 *
00008 * Copyright (C) [2011-2012]
00009 * Hosted at: https://github.com/studentkittens/Freya
00010 *
00011 *              __..--''``---....___   _..._    __
00012 *    /// //_.-'    .-/";  `        ``<._  ``.''_ `. / // /
00013 *   ///_.-' _..--.'_                        `( ) ) // //
00014 *   / (_..-' // (< _     ;_..__               ; `' / ///
00015 *    / // // //  `-._,_)' // / ``--...____..-' /// / //
00016 *  Ascii-Art by Felix Lee <flee@cse.psu.edu>
00017 *
00018 * Freya is free software: you can redistribute it and/or modify
00019 * it under the terms of the GNU General Public License as published by
00020 * the Free Software Foundation, either version 3 of the License, or
00021 * (at your option) any later version.
00022 *
00023 * Freya is distributed in the hope that it will be useful,
00024 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00026 * GNU General Public License for more details.
00027 *
00028 * You should have received a copy of the GNU General Public License
00029 * along with Freya. If not, see <http://www.gnu.org/licenses/>.
00030 **************************************************************/
00031 #ifndef FREYA_CLIENT_GUARD
00032 #define FREYA_CLIENT_GUARD
00033 
00034 #include  "BaseClient.hh"
00035 
00036 /* Songlist interface */
00037 #include "AbstractItemGenerator.hh"
00038 
00039 namespace MPD
00040 {
00044     class Client : public BaseClient, public AbstractItemGenerator
00045     {
00046     public:
00047 
00055         Client();
00056 
00060         ~Client();
00061 
00067         void connect();
00075         void disconnect();
00076 
00082         bool playback_next();
00088         bool playback_prev();
00097         bool playback_stop();
00103         bool playback_play();
00112         bool playback_pause();
00113 
00120         void playback_seek(unsigned song_id, unsigned abs_time);
00126         void playback_crossfade(unsigned seconds);
00127 
00131         void toggle_random();
00135         void toggle_consume();
00139         void toggle_repeat();
00143         void toggle_single();
00144 
00150         void play_song_at_id(unsigned song_id);
00156         void playlist_save(const char * name);
00157 
00163         void queue_add(const char * url);
00167         void queue_clear();
00173         void queue_delete(unsigned pos);
00174 
00184         unsigned database_update(const char * path);
00194         unsigned database_rescan(const char * path);
00195 
00201         void set_volume(unsigned vol);
00202 
00210         void fill_queue(AbstractItemlist& data_model);
00218         void fill_queue_changes(AbstractItemlist& data_model, unsigned last_version, unsigned& first_pos);
00224         void fill_playlists(AbstractItemlist& data_model);
00230         void fill_outputs(AbstractItemlist& data_model);
00237         void fill_filelist(AbstractItemlist& data_model, const char * path);
00238 
00249         bool send_command(const char * command);
00250 
00256         bool ping();
00257     };
00258 
00259 }
00260 
00261 #endif