SCTC
the soundcloud.com terminal client
Macros | Enumerations | Functions
state.h File Reference
#include "track.h"
#include "tui.h"
Include dependency graph for state.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LIST_STREAM   0
 
#define LIST_BOOKMARKS   1
 
#define NOTHING_SELECTED   ((unsigned int) ~0)
 

Enumerations

enum  callback_event {
  cbe_textbox_modified = 0, cbe_repeat_modified, cbe_tabs_modified, cbe_titlebar_modified,
  cbe_statusbar_modified, cbe_input_modified, cbe_sugg_modified, cbe_list_modified,
  callback_event_size
}
 
enum  repeat { rep_none, rep_one, rep_all }
 

Functions

void state_add_list (struct track_list *_list)
 
size_t state_get_current_list ()
 Get the id of the currently displayed list. More...
 
struct track_liststate_get_list (size_t id)
 Get the track_list for a specific id. More...
 
enum repeat state_get_repeat ()
 Get the current repeat state. More...
 
char * state_get_title_text ()
 Get the current text in the title bar. More...
 
char * state_get_status_text ()
 Get the current text in the status bar. More...
 
enum color state_get_status_color ()
 Get the current color of the text in the status bar. More...
 
char * state_get_tb_text ()
 Get the text of the currently visible textbox. More...
 
char * state_get_tb_title ()
 Get the title of the currently visible textbox. More...
 
char * state_get_input ()
 
struct commandstate_get_commands ()
 
size_t state_get_current_time ()
 
size_t state_get_tb_old_pos ()
 
size_t state_get_tb_pos ()
 
size_t state_get_old_selected ()
 
size_t state_get_current_selected ()
 
size_t state_get_current_position ()
 
size_t state_get_sugg_selected ()
 
size_t state_get_current_playback_list ()
 
size_t state_get_current_playback_track ()
 
bool state_init ()
 Global initialization of the internal state of SCTC. More...
 
bool state_finalize ()
 Global finalization of the internal state of SCTC. More...
 
void state_set_commands (struct command *commands)
 
void state_set_current_list (size_t list)
 
void state_set_current_position (size_t pos)
 
void state_set_current_selected (size_t selected)
 
void state_set_current_selected_rel (int delta)
 
void state_set_repeat (enum repeat repeat)
 
void state_set_title (char *title_line_text)
 
void state_set_status (enum color color, char *text)
 
void state_set_tb (char *title, char *text)
 
void state_set_current_time (size_t time)
 
void state_set_sugg_selected (size_t selected)
 
void state_set_tb_pos (size_t pos)
 
void state_set_tb_pos_rel (int delta)
 
void state_set_current_playback (size_t list, size_t track)
 
void state_register_callback (enum callback_event evt, void(*cb)(void))
 

Macro Definition Documentation

#define LIST_BOOKMARKS   1
#define LIST_STREAM   0
#define NOTHING_SELECTED   ((unsigned int) ~0)

Enumeration Type Documentation

Enumerator
cbe_textbox_modified 
cbe_repeat_modified 
cbe_tabs_modified 
cbe_titlebar_modified 
cbe_statusbar_modified 
cbe_input_modified 
cbe_sugg_modified 
cbe_list_modified 
callback_event_size 
enum repeat
Enumerator
rep_none 
rep_one 
rep_all 

Function Documentation

void state_add_list ( struct track_list _list)

Here is the caller graph for this function:

bool state_finalize ( )

Global finalization of the internal state of SCTC.

This function is required to be called prior to termination of SCTC. Do not use any state_* after calling this function.

Returns
true in case of success, false otherwise

Here is the caller graph for this function:

bool state_init ( )

Global initialization of the internal state of SCTC.

This function is required to be called prior to the first call to any other state_* function.

Returns
true in case of success, false otherwise

Here is the caller graph for this function:

void state_register_callback ( enum callback_event  evt,
void(*)(void)  cb 
)

Here is the caller graph for this function: