Index Class Reference

#include <index.h>

Collaboration diagram for Index:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Index ()
 Index (QString)
 ~Index ()
void read_idx (QString)
bool write_idx ()
bool write_idx (QString t)
QString get_storedin ()
void set_storedin (QString t)
bool changed ()
void set_changed ()
QString get_filename ()
void set_filename (QString fn)
period_type get_period ()
void set_period (period_type t, bool update_on_disk=true)
tempo_type get_tempo ()
HistoryFieldadd_prev_song (QString mp3)
HistoryFieldadd_next_song (QString mp3)
HistoryField ** get_prev_songs ()
HistoryField ** get_next_songs ()
void add_prev_history (HistoryField *)
void add_next_history (HistoryField *)
QString get_title ()
void set_title (QString t)
QString get_display_title ()
QString readable_description ()
bool set_title_author_remix (QString filename)
QString get_author ()
void set_author (QString new_author)
QString get_version ()
void set_version (QString new_version)
QString get_remix ()
void set_remix (QString t)
void set_tags (QString str)
QString get_tags ()
bool fully_defined_energy ()
void clear_energy ()
sample4_type get_min ()
sample4_type get_max ()
sample4_type get_mean ()
power_type get_power ()
void add_album (AlbumField *)
void delete_album (QString name)
AlbumFieldfind_album (QString name)
AlbumField ** get_albums ()
AlbumField ** copy_albums ()
unsigned8 get_cue ()
unsigned8 get_cue_z ()
unsigned8 get_cue_x ()
unsigned8 get_cue_c ()
unsigned8 get_cue_v ()
void set_cue (unsigned8 c)
void set_cue_z (unsigned8 c)
void set_cue_x (unsigned8 c)
void set_cue_c (unsigned8 c)
void set_cue_v (unsigned8 c)
void set_time (QString str)
QString get_time ()
unsigned2 get_time_in_seconds ()
QString get_md5sum ()
void set_md5sum (QString s)
void set_spectrum (spectrum_type *s)
spectrum_typeget_spectrum ()
void set_histogram (echo_property h)
echo_property get_histogram ()
rhythm_property get_rhythm ()
void set_rhythm (rhythm_property r)
void set_composition (composition_property r)
composition_property get_composition ()
capacity_type get_disabled_capacities ()
void set_disabled_capacities (capacity_type c)
void executeInfoDialog ()
unsigned4 get_playcount ()

Public Attributes

sample4_type index_min
sample4_type index_max
sample4_type index_mean
power_type index_power
capacity_type index_disabled_capacities

Friends

class SongInformation

Constructor & Destructor Documentation

Index::Index (  ) 

Initializes empty index

Index::Index ( QString  from  ) 

Reads index from disk

References read_idx().

Index::~Index (  ) 

Deep destroy of object


Member Function Documentation

void Index::add_album ( AlbumField a  ) 

References bpmdj_reallocate.

Referenced by read_idx().

void Index::add_next_history ( HistoryField h  ) 

Referenced by read_idx().

HistoryField * Index::add_next_song ( QString  mp3  ) 

References HistoryField::count.

void Index::add_prev_history ( HistoryField h  ) 

Referenced by read_idx().

HistoryField * Index::add_prev_song ( QString  mp3  ) 

References HistoryField::count.

bool Index::changed (  )  [inline]

Returns whether the data has changed

Referenced by core_done(), and Song::refill().

void Index::clear_energy (  ) 
AlbumField ** Index::copy_albums (  ) 

References bpmdj_allocate.

Referenced by Song::refill().

void Index::delete_album ( QString  name  ) 

References AlbumField::name.

void Index::executeInfoDialog (  ) 
AlbumField * Index::find_album ( QString  name  ) 
bool Index::fully_defined_energy (  ) 
AlbumField* * Index::get_albums (  )  [inline]
QString Index::get_author (  )  [inline]

Referenced by Song::refill().

composition_property Index::get_composition (  )  [inline]

Referenced by Song::refill().

unsigned8 Index::get_cue (  )  [inline]

Referenced by cue_read().

unsigned8 Index::get_cue_c (  )  [inline]

Referenced by cue_read(), and Song::refill().

unsigned8 Index::get_cue_v (  )  [inline]

Referenced by cue_read(), and Song::refill().

unsigned8 Index::get_cue_x (  )  [inline]

Referenced by cue_read(), main(), and Song::refill().

unsigned8 Index::get_cue_z (  )  [inline]

Referenced by cue_read(), and Song::refill().

capacity_type Index::get_disabled_capacities (  )  [inline]
QString Index::get_display_title (  ) 

Referenced by Song::refill().

QString Index::get_filename (  )  [inline]
echo_property Index::get_histogram (  )  [inline]

Referenced by Song::refill().

sample4_type Index::get_max (  )  [inline]
QString Index::get_md5sum (  )  [inline]

Referenced by batch_start(), and Song::refill().

sample4_type Index::get_mean (  )  [inline]

References index_mean.

Referenced by batch_start(), Song::refill(), and rms_init().

sample4_type Index::get_min (  )  [inline]
HistoryField* * Index::get_next_songs (  )  [inline]
period_type Index::get_period (  )  [inline]

Referenced by core_meta_init().

unsigned4 Index::get_playcount (  ) 

References HistoryField::count.

Referenced by Song::refill().

power_type Index::get_power (  )  [inline]

References index_power.

Referenced by batch_start(), Song::refill(), and rms_init().

HistoryField* * Index::get_prev_songs (  )  [inline]
QString Index::get_remix (  )  [inline]
rhythm_property Index::get_rhythm (  )  [inline]

Referenced by Song::refill().

spectrum_type * Index::get_spectrum (  ) 

References no_spectrum.

Referenced by batch_start(), and Song::refill().

QString Index::get_storedin (  )  [inline]

Returns the place where this index is stored in

Referenced by MusicScanner::checkfile(), SongSlot::getPlayCommand(), main(), Song::refill(), and SongSlot::startChecking().

QString Index::get_tags (  )  [inline]

Referenced by batch_start(), and Song::refill().

tempo_type Index::get_tempo (  )  [inline]
QString Index::get_time (  )  [inline]
unsigned2 Index::get_time_in_seconds (  ) 

Referenced by batch_start().

QString Index::get_title (  )  [inline]
QString Index::get_version (  )  [inline]

Referenced by Song::refill().

void Index::read_idx ( QString  indexn  ) 
QString Index::readable_description (  ) 
void Index::set_author ( QString  new_author  )  [inline]
void Index::set_changed (  )  [inline]

Marks the index as 'changed'

Referenced by EnergyAnalyzer::analyze().

void Index::set_composition ( composition_property  r  )  [inline]
void Index::set_cue ( unsigned8  c  )  [inline]

Referenced by cue_write().

void Index::set_cue_c ( unsigned8  c  )  [inline]

Referenced by cue_write().

void Index::set_cue_v ( unsigned8  c  )  [inline]

Referenced by cue_write().

void Index::set_cue_x ( unsigned8  c  )  [inline]

Referenced by cue_write().

void Index::set_cue_z ( unsigned8  c  )  [inline]

Referenced by cue_write().

void Index::set_disabled_capacities ( capacity_type  c  )  [inline]
void Index::set_filename ( QString  fn  )  [inline]
void Index::set_histogram ( echo_property  h  )  [inline]
void Index::set_md5sum ( QString  s  )  [inline]

Referenced by Md5Analyzer::analyze().

void Index::set_period ( period_type  t,
bool  update_on_disk = true 
)

If the period is different from the old period then we remove the rhythm information and composition information

References histogram_property< bandsize >::clear(), period_type::period, and write_idx().

Referenced by createNewIndexFor(), and set_normalperiod_metarate().

void Index::set_remix ( QString  t  )  [inline]
void Index::set_rhythm ( rhythm_property  r  )  [inline]
void Index::set_spectrum ( spectrum_type s  )  [inline]
void Index::set_storedin ( QString  t  )  [inline]

Sets the place where this index is stored in

Referenced by createNewIndexFor(), and SongSlot::startChecking().

void Index::set_tags ( QString  str  )  [inline]

Referenced by batch_start(), and createNewIndexFor().

void Index::set_time ( QString  str  ) 

Referenced by writer_died().

void Index::set_title ( QString  t  )  [inline]
bool Index::set_title_author_remix ( QString  meta_filename  ) 

Tries to figure out the name, remix, author and version from the song filename

This function tries to find title, author and remix in the filename and set the specified fields in the index.

This function probably still leaks memory but it is only used when a new index is created. So at the moment I don't care that much.

busy = 0, started with title busy = 1, started with remix busy = 2, ended with remix busy = 3, started with author busy = 4, started with author, started with version busy >= 6, ended with a crash

References bpmdj_deallocate.

Referenced by UpdateIndexedSong::change(), and createNewIndexFor().

void Index::set_version ( QString  new_version  )  [inline]
bool Index::write_idx ( QString  t  )  [inline]

Writes the index to a new filename, replaces meta_filename first Returns true if the file was completely written. False otherwise.

References write_idx().

bool Index::write_idx (  ) 

Writes the index to the file 'meta_filename'. Returns true if the file was completely written. False otherwise.

#1155. To avoid incomplete files we write to a tmp file. If that file was writeable then we use that one.

References Error(), exists(), fclose(), FILE, fsize(), AlbumField::get_data(), power_type::get_data(), sample4_type::get_data(), histogram_property< bandsize >::get_data(), spectrum_type::get_data(), index_disabled_capacities, index_max, index_mean, index_min, index_power, and no_spectrum.

Referenced by UpdateIndexedSong::change(), core_done(), Song::refill(), set_period(), SongSlot::startChecking(), and write_idx().


Friends And Related Function Documentation

friend class SongInformation [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2