BVB Source Codes

cmus Show editable.h Source code

Return Download cmus: download editable.h Source code - Download cmus Source code - Type:.h
  1. /*
  2.  * Copyright 2008-2013 Various Authors
  3.  * Copyright 2006 Timo Hirvonen
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License as
  7.  * published by the Free Software Foundation; either version 2 of the
  8.  * License, or (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. #ifndef CMUS_EDITABLE_H
  20. #define CMUS_EDITABLE_H
  21.  
  22. #include "window.h"
  23. #include "list.h"
  24. #include "rbtree.h"
  25. #include "track.h"
  26. #include "locking.h"
  27. #include "cmus.h"
  28.  
  29. struct editable;
  30.  
  31. typedef void (*editable_free_track)(struct editable *e, struct list_head *head);
  32.  
  33. struct editable_shared {
  34.         struct editable *owner;
  35.  
  36.         struct window *win;
  37.         sort_key_t *sort_keys;
  38.         char sort_str[128];
  39.         editable_free_track free_track;
  40.         struct searchable *searchable;
  41. };
  42.  
  43. struct editable {
  44.         struct list_head head;
  45.         struct rb_root tree_root;
  46.         unsigned int nr_tracks;
  47.         unsigned int nr_marked;
  48.         unsigned int total_time;
  49.         struct editable_shared *shared;
  50. };
  51.  
  52. void editable_shared_init(struct editable_shared *shared,
  53.                 editable_free_track free_track);
  54. void editable_shared_set_sort_keys(struct editable_shared *shared,
  55.                 sort_key_t *keys);
  56.  
  57. void editable_init(struct editable *e, struct editable_shared *shared,
  58.                 int take_ownership);
  59. void editable_take_ownership(struct editable *e);
  60. void editable_add(struct editable *e, struct simple_track *track);
  61. void editable_add_before(struct editable *e, struct simple_track *track);
  62. void editable_remove_track(struct editable *e, struct simple_track *track);
  63. void editable_remove_sel(struct editable *e);
  64. void editable_sort(struct editable *e);
  65. void editable_rand(struct editable *e);
  66. void editable_toggle_mark(struct editable *e);
  67. void editable_move_after(struct editable *e);
  68. void editable_move_before(struct editable *e);
  69. void editable_clear(struct editable *e);
  70. void editable_remove_matching_tracks(struct editable *e,
  71.                 int (*cb)(void *data, struct track_info *ti), void *data);
  72. void editable_mark(struct editable *e, const char *filter);
  73. void editable_unmark(struct editable *e);
  74. void editable_invert_marks(struct editable *e);
  75. int _editable_for_each_sel(struct editable *e, track_info_cb cb, void *data,
  76.                 int reverse);
  77. int editable_for_each_sel(struct editable *e, track_info_cb cb, void *data,
  78.                 int reverse);
  79. int editable_for_each(struct editable *e, track_info_cb cb, void *data,
  80.                 int reverse);
  81. void editable_update_track(struct editable *e, struct track_info *old, struct track_info *new);
  82. int editable_empty(struct editable *e);
  83.  
  84. static inline void editable_track_to_iter(struct editable *e, struct simple_track *track, struct iter *iter)
  85. {
  86.         iter->data0 = &e->head;
  87.         iter->data1 = track;
  88.         iter->data2 = NULL;
  89. }
  90.  
  91. #endif
  92.  
downloadeditable.h Source code - Download cmus Source code
Related Source Codes/Software:
Ink - An HTML5/CSS3 framework used at SAPO for fast and ... 2017-04-22
memory-stats.js - minimal monitor for JS Heap Size via performance.m... 2017-04-22
LayoutKit - LayoutKit is a fast view layout library for iOS, m... 2017-04-22
Cpp-Primer - C++ Primer 5 answer 2017-04-22
RBBAnimation - Block-based animations made easy, comes with easin... 2017-04-22
phpDocumentor2 - Documentation Generator for PHP ... 2017-04-22
flexboxfroggy - A game for learning CSS flexbox ... 2017-04-22
wicked - Use wicked to turn your controller into a wizard ... 2017-04-22
Begin-Latex-in-minutes - Brief Intro to LaTeX for beginners that helps you ... 2017-04-22
guard-livereload - Guard::LiveReload automatically reload your browse... 2017-04-22
swifter - Tiny http server engine written in Swift programmi... 2017-04-29
Chartbuilder - A front-end charting application that facilitates ... 2017-04-29
offline-first - 2017-04-29
plotly.py - An interactive, browser-based graphing library for... 2017-04-29
statsmodels - Statsmodels: statistical modeling and econometrics... 2017-04-29
android-maps-utils - Handy extensions to the Google Maps Android API. 2017-04-29
enyo - A JavaScript application framework emphasizing mod... 2017-04-29
darkforestGo - DarkForest, the Facebook Go engine. 2017-04-29
erpnext - ERP made Simple http://erpn... 2017-04-29
SwiftInFlux - An attempt to gather all that is in flux in Swift. 2017-04-29

 Back to top