BVB Source Codes

cmus Show cue.h Source code

Return Download cmus: download cue.h Source code - Download cmus Source code - Type:.h
  1. /*
  2.  * Copyright 2016 Various Authors
  3.  *
  4.  * This program is free software: you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation, either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16.  */
  17.  
  18. #ifndef CMUS_CUE_H
  19. #define CMUS_CUE_H
  20.  
  21. #include <stdint.h>
  22.  
  23. struct cue_meta {
  24.         char *performer;
  25.         char *songwriter;
  26.         char *title;
  27.         char *genre;
  28.         char *date;
  29.         char *comment;
  30. };
  31.  
  32. struct cue_track {
  33.         double offset;
  34.         double length;
  35.         struct cue_meta meta;
  36. };
  37.  
  38. struct cue_sheet {
  39.         char *file;
  40.  
  41.         struct cue_track *tracks;
  42.         size_t num_tracks;
  43.         size_t track_base;
  44.  
  45.         struct cue_meta meta;
  46. };
  47.  
  48. struct cue_sheet *cue_parse(const char *src, size_t len);
  49. struct cue_sheet *cue_from_file(const char *file);
  50. void cue_free(struct cue_sheet *s);
  51.  
  52. static inline struct cue_track *cue_get_track(struct cue_sheet *s, size_t n)
  53. {
  54.         size_t offset = n - s->track_base;
  55.         if (n < s->track_base || offset > s->num_tracks)
  56.                 return NULL;
  57.         return &s->tracks[offset];
  58. }
  59.  
  60. #endif
  61.  
downloadcue.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