summaryrefslogtreecommitdiff
path: root/muse_qt4_evolution/midiplugins/trigg/trigggui.cpp
blob: 0fd3c4c642b05fd418aa9e41c3fc189832039df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//=========================================================
//  MusE
//  Linux Music Editor
//  $Id: filtergui.cpp,v 1.4 2005/11/06 17:49:34 wschweer Exp $
//
//  (C) Copyright 2005 Werner Schweer (ws@seh.de)
//=========================================================

#include "trigggui.h"
#include "trigg.h"

//---------------------------------------------------------
//   MidiTriggConfig
//---------------------------------------------------------

TriggGui::TriggGui(Trigg* f, QWidget* parent)
  : QDialog(parent)
      {
      setupUi(this);
      filter = f;

      connect(noteEntry, SIGNAL(valueChanged(int)), SLOT(setNote(int)));
      connect(velocityEntry, SIGNAL(valueChanged(int)), SLOT(setVelocity(int)));
      }

//---------------------------------------------------------
//   init
//---------------------------------------------------------
void TriggGui::init()
      {
      Trigg::initData *data;
      int n;
      filter->getInitData(&n,(const unsigned char **)&data);
      printf("::init note=%d vel=%d\n",data->note,data->velocity);
      noteEntry->setValue(data->note);
      velocityEntry->setValue(data->velocity);
      }

//---------------------------------------------------------
//   setNote
//---------------------------------------------------------
void TriggGui::setNote(int value)
      {
      printf("TriggGui::setNote %d\n",value);
      filter->setNote(value);
      }

//---------------------------------------------------------
//   setVelocity
//---------------------------------------------------------
void TriggGui::setVelocity(int value)
      {
      printf("TriggGui::setVelocity %d\n",value);
      filter->setVelocity(value);
      }