SCTC
the soundcloud.com terminal client
Data Fields
track Struct Reference

The basic datastructure representing a single track. More...

#include <track.h>

Collaboration diagram for track:

Data Fields

char * name
 the tracks name More...
 
union {
   struct {
      char *   stream_url
 The URL used for streaming this track. More...
 
      char *   permalink_url
 
      char *   download_url
 The URL pointing to the download. Might be NULL, if the uploader does not provide a download. More...
 
      char *   username
 The username. More...
 
      char *   description
 
      struct tm   created_at
 
      int   duration
 duration in seconds More...
 
      int   user_id
 
      int   track_id
 
      uint8_t   flags
 
      int   current_position
 current position More...
 
   } 
 
   struct track *   href
 Pointer to a normal track (only valid if name == NULL) More...
 
}; 
 

Detailed Description

The basic datastructure representing a single track.

SCTC knows two different kind of tracks:

  1. The normal track

    The normal track behaves just like one would expect. All the entries are filled with (valid) values (except href).

  2. The reference track

    The reference track, in contrast, is very different: As soon as name contains NULL a track is a reference track. Therefore the only usable value is href, a pointer to a normal track containing the actual data.

    Warning
    For a reference track, you must not try to access any members, except from name (which is NULL) and href (a valid ptr to a normal track)

Field Documentation

union { ... }
struct tm track::created_at
int track::current_position

current position

char* track::description
char* track::download_url

The URL pointing to the download. Might be NULL, if the uploader does not provide a download.

int track::duration

duration in seconds

uint8_t track::flags
struct track* track::href

Pointer to a normal track (only valid if name == NULL)

char* track::name

the tracks name

char* track::permalink_url

The URL to the permanent location of this track.

This URL cannot be used for streaming without further actions.

char* track::stream_url

The URL used for streaming this track.

int track::track_id
int track::user_id
char* track::username

The username.


The documentation for this struct was generated from the following file: