/*****************************************************************
 * gmerlin - a general purpose multimedia framework and applications
 *
 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
 * gmerlin-general@lists.sourceforge.net
 * http://gmerlin.sourceforge.net
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * *****************************************************************/

#include <stdlib.h>

#include <config.h>
#include <gmerlin/translation.h>
#include <gmerlin/utils.h>
#include "gui.h"
#include <gui_gtk/gtkutils.h>
#include <gui_gtk/message.h>

static void nocards()
  {
  bg_gtk_message(TR("Could not find any Alsa mixers.\nCheck your setup!\n"), BG_GTK_MESSAGE_ERROR, NULL);
  exit(-1);
  }

int main(int argc, char ** argv)
  {
  alsa_mixer_t * mixer;
  mixer_window_t * mixer_window;

  bg_cfg_registry_init("alsamixer");
  
  //  alsa_mixer_dump(mixer);

  bg_gtk_init(&argc, &argv, "mixer_icon.png", NULL, NULL);

  mixer = alsa_mixer_create();

  if(!mixer)
    {
    nocards();
    }
  
  mixer_window = mixer_window_create(mixer, bg_cfg_registry);
  
  mixer_window_run(mixer_window);

  mixer_window_destroy(mixer_window);
  alsa_mixer_destroy(mixer);
  
  /* Cleanup */

  bg_cfg_registry_save();
  
  bg_cfg_registry_cleanup();
  
  return 0;
  }
