hydrogen 1.2.6
LashClient.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#include <core/config.h>
24
25#if defined(H2CORE_HAVE_LASH) || _DOXYGEN_
26
27#ifndef LASH_CLIENT
28#define LASH_CLIENT
29
30#include <lash-1.0/lash/lash.h>
31
32#include <string>
33#include <cassert>
34
37{
38public:
39 static LashClient* get_instance() { assert(__instance); return __instance;}
40 static void create_instance(
41 const char *lashClass,
42 const char *viewName,
43 int *argc,
44 char ***argv
45 );
46
47 LashClient(const char* lashClass, const char* viewName, int* argc, char ***argv);
49
50 bool isConnected();
51
52 void sendEvent(LASH_Event_Type eventType, const char* value);
53 void sendEvent(LASH_Event_Type eventType);
54
62 void setJackClientName( const std::string& jackClientName );
63 void sendJackClientName();
64 void setAlsaClientId(unsigned char id);
65 void sendAlsaClientId();
66
67 lash_event_t* getNextEvent();
68 lash_client_t* getConnection();
69
70 void setNewProject(bool value);
71 bool isNewProject();
72private:
74 lash_client_t* lashClient;
80 std::string jackClientName;
81 unsigned char alsaClientId;
83};
84
85#endif // LASH_CLIENT
86#endif // H2CORE_HAVE_LASH
87
88
bool newProject
Definition LashClient.h:73
static void create_instance(const char *lashClass, const char *viewName, int *argc, char ***argv)
static reference of LashClient class (Singleton)
lash_client_t * getConnection()
bool isNewProject()
void sendAlsaClientId()
lash_event_t * getNextEvent()
void sendEvent(LASH_Event_Type eventType, const char *value)
bool isConnected()
unsigned char alsaClientId
Definition LashClient.h:81
static LashClient * get_instance()
Definition LashClient.h:39
std::string jackClientName
Name of the external JACK client Hydrogen is using to communicate with the JACK server.
Definition LashClient.h:80
void setNewProject(bool value)
static LashClient * __instance
Definition LashClient.h:82
lash_client_t * lashClient
Definition LashClient.h:74
LashClient(const char *lashClass, const char *viewName, int *argc, char ***argv)
void setJackClientName(const std::string &jackClientName)
Set the name of the JACK client by modifying jackClientName.
void setAlsaClientId(unsigned char id)
void sendJackClientName()