scripts.cpp File Reference

#include <cstdio>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <libgen.h>
#include <qmessagebox.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdarg.h>
#include "index.h"
#include "scripts.h"
#include "memory.h"
#include "bpmplay.h"
#include "overseer.h"
#include "info.h"
Include dependency graph for scripts.cpp:

Functions

char * getRawFilename (const char *rawpath, const char *n)
FILE * openRawFile (Index *index, const char *rawpath)
FILE * openRawFileForWriting (Index *index, const char *d)
void removeRaw (Index *index, char *d)
void dumpAudio (const char *fname, unsigned4 *buffer, long length)
FILE * openScriptFile (const char *name)
void Remote (const char *script,...)
char * escape (const char *in)
QString escape (const QString &in)
void start_mkdir (const QString &dir)
void start_cp (const QString &from, const QString &to)
int start_mv (const QString &from, const QString &to)
void start_rm (const QString &what)
void remove (QString a)
void removeAllRaw (const char *d)
void removeAllLog ()
int bpmdjraw (bool synchronous, const char *fname, const char *where)
int bpmdjraw (bool synchronous, const char *fname, QString where)
ExitStatus vexec (const char *description, const char *script,...)
bool execute (QString description, QString script)
bool vexecute (const char *script,...)

Function Documentation

int bpmdjraw ( bool  synchronous,
const char *  fname,
QString  where 
)

References bpmdjraw().

int bpmdjraw ( bool  synchronous,
const char *  fname,
const char *  where 
)

Will start bpmdjraw and wait for the result or not depending on the synchronous flag. The return value is the process id in the asynchronous case, 0 when there was an error. The location to place the rawfile is obtained through the raw_location() function call.

References bpmdj_deallocate, escape(), execute(), spawn(), and sprintf().

Referenced by bpmdjraw(), createFiles(), wave_open(), and DecoderChecker::works().

void dumpAudio ( const char *  fname,
unsigned4 *  buffer,
long  length 
)

References fclose(), FILE, and writesamples().

QString escape ( const QString &  in  ) 

References bpmdj_deallocate, and escape().

char* escape ( const char *  in  ) 

The escaping necessary for ssh to work is ridiculous.. An ordinary containment within " ... " does not work, so we must escape every character on its own. Especially the & is important because this would otherwise spawn a background process.

References assert(), and i.

Referenced by Md5Analyzer::analyze(), bpmdjraw(), ActiveFragmentCreator::createOneFor(), delete_remote(), SongSelectorLogic::doAutoMix(), escape(), from_remote(), SongSlot::getAnalCommand(), SongSlot::getPlayCommand(), remote(), removeAllRaw(), start_cp(), start_mkdir(), start_mv(), start_rm(), and to_remote().

bool execute ( QString  description,
QString  script 
)
char* getRawFilename ( const char *  rawpath,
const char *  n 
)
FILE* openRawFile ( Index index,
const char *  rawpath 
)
FILE* openRawFileForWriting ( Index index,
const char *  d 
)
FILE* openScriptFile ( const char *  name  ) 

References assert(), FILE, script, and SHELL_HEADER.

Referenced by SongSelectorLogic::doAutoMix().

void Remote ( const char *  script,
  ... 
)

References Log().

Referenced by remote().

void remove ( QString  a  ) 

References remove().

Referenced by remove().

void removeAllLog (  ) 

References execute().

Referenced by main().

void removeAllRaw ( const char *  d  ) 

References bpmdj_deallocate, escape(), RAW_EXT, and vexecute().

Referenced by main().

void removeRaw ( Index index,
char *  d 
)
void start_cp ( const QString &  from,
const QString &  to 
)
void start_mkdir ( const QString &  dir  ) 

References escape(), exec(), and sprintf().

Referenced by ActiveSongCopier::fetchNextSong().

int start_mv ( const QString &  from,
const QString &  to 
)

References escape(), execute(), and sprintf().

Referenced by UpdateSongFilename::change().

void start_rm ( const QString &  what  ) 

References escape(), and vexecute().

Referenced by main().

ExitStatus vexec ( const char *  description,
const char *  script,
  ... 
)

Two wrappers to make command line arguments easier

References exec().

bool vexecute ( const char *  script,
  ... 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2