/*
 * daap_config.c: the configuration implementation
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: daap_config.c,v 1.7 2005/10/26 13:10:24 cm Exp $
 */

#include <stdlib.h>
#include <string.h>
#include "daap_config.h"

// --- cDaapConfiguration ------------------------------------------------------

cDaapConfiguration::cDaapConfiguration() :
  m_menuEntry(true), m_audioOnly(false), mp_instantPlaylistName(NULL),
  m_skipBackMargin(10), m_skipLength(10) {

  mp_instantPlaylistName = strdup("Instant");
}

cDaapConfiguration::~cDaapConfiguration() {
  free(mp_instantPlaylistName);
}

bool cDaapConfiguration::SetMenuEntry(bool set) {
  return m_menuEntry = set;
}

bool cDaapConfiguration::SetAudioOnly(bool set) {
  return m_audioOnly = set;
}

const char *cDaapConfiguration::SetInstantPlaylistName(const char *name) {
  if (NULL == name)
    return NULL;

  if (NULL != mp_instantPlaylistName)
    free(mp_instantPlaylistName);

  return mp_instantPlaylistName = strdup(name);
}

int cDaapConfiguration::SetSkipBackMargin(int set) {
  return m_skipBackMargin = set;
}

int cDaapConfiguration::SetSkipLength(int set) {
  return m_skipLength = set;
}
