This commit is contained in:
tzim 2013-11-15 00:16:34 +00:00
parent 32bac3e8ce
commit 19ab3ac359
4 changed files with 55 additions and 15 deletions

View file

@ -28,6 +28,8 @@ namespace DMX2
MidiEventProvider midip=null;
actionEventTarget masterEventTarget;
public Conduite()
{
timer = new Timer(new TimerCallback(TimerTick),this, 1000,10);
@ -42,6 +44,12 @@ namespace DMX2
midip = new MidiEventProvider(eventManager);
masterEventTarget = new actionEventTarget(
delegate(EventData data){
Master = 100 * data.value /255;
return true;
});
}
EventManager eventManager = new EventManager();
@ -221,9 +229,11 @@ namespace DMX2
public void BindMaster (string eventId)
{
//TODO
throw new NotImplementedException ();
if (eventId.Length == 0) {
Conduite.Courante.EventManager.Unbind (masterEventTarget);
return;
}
Conduite.Courante.EventManager.Bind(eventId,masterEventTarget);
}

View file

@ -498,6 +498,7 @@ namespace DMX2
if(fullUpdateFlag) ConstruitMatriceSeqColumns();
if( Conduite.Courante.SequenceurMaitre.EffetChange() )MatriceUI.QueueDraw();
fullUpdateFlag=false;
masterScale.Value = Conduite.Courante.Master;
updScheduled=false;
}
@ -558,9 +559,8 @@ namespace DMX2
protected void OnMasterScaleValueChanged (object sender, EventArgs e)
{
Conduite.Courante.Master = (int)(masterScale.Value);
ChangeMatriceCouleur();
if(!updScheduled) Conduite.Courante.Master = (int)(masterScale.Value);
ChangeCouleurInfo();
}
@ -610,15 +610,15 @@ namespace DMX2
protected void OnBtnPauseToggled (object sender, EventArgs e)
{
Conduite.Courante.Pause = btnPause.Active;
ChangeMatriceCouleur();
ChangeCouleurInfo();
}
protected void OnBtnBlackOutToggled (object sender, EventArgs e)
{
Conduite.Courante.BlackOut = btnBlackOut.Active;
ChangeMatriceCouleur();
ChangeCouleurInfo();
}
void ChangeMatriceCouleur ()
void ChangeCouleurInfo ()
{
if (Conduite.Courante.BlackOut) {

View file

@ -109,7 +109,17 @@ namespace DMX2
SequenceurLineaire seq;
int max=0, signe=-2;
public bool Attache{ get; set; }
bool attache;
public bool Attache {
get {
return attache;
}
set {
signe=-2;
attache = value;
}
}
public circuitEventTarget(SequenceurLineaire _seq, Circuit _c){
seq=_seq;

View file

@ -12,7 +12,7 @@ namespace DMX2
string nom;
TimeSpan duree = TimeSpan.Zero;
Dictionary<Sequenceur,string> data = new Dictionary<Sequenceur, string>();
public string Nom {
get {
return nom;
@ -82,6 +82,8 @@ namespace DMX2
Ligne enCours = null;
TimeSpan timeStamp = TimeSpan.Zero;
actionEventTarget goNextEventTarget=null;
actionEventTarget goBackEventTarget=null;
bool change = false;
@ -185,6 +187,18 @@ namespace DMX2
public SequenceurMaitre ()
{
//lignes.Add(new Ligne());
goNextEventTarget = new actionEventTarget(
delegate(EventData data){
if(data.value!=0) EffetSuivant();
return true;
});
goBackEventTarget = new actionEventTarget(
delegate(EventData data){
if(data.value!=0) EffetPrecedent();
return true;
});
}
public int AjoutLigne (int pos)
@ -230,14 +244,20 @@ namespace DMX2
public void BindEffetSuivant (string eventId)
{
//TODO
throw new NotImplementedException ();
if (eventId.Length == 0) {
Conduite.Courante.EventManager.Unbind (goNextEventTarget);
return;
}
Conduite.Courante.EventManager.Bind(eventId,goNextEventTarget);
}
public void BindEffetPrecedent (string eventId)
{
//TODO
throw new NotImplementedException ();
if (eventId.Length == 0) {
Conduite.Courante.EventManager.Unbind (goBackEventTarget);
return;
}
Conduite.Courante.EventManager.Bind(eventId,goBackEventTarget);
}
public void Save (XmlElement parent)
{