Project

General

Profile

Download (2.59 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / EffectQueueOther.java @ d07f2950

1 b3618cb5 Leszek Koltunski
package org.distorted.library;
2
3
///////////////////////////////////////////////////////////////////////////////////////////////////
4
5
import java.util.Vector;
6
7
/**
8 d07f2950 Leszek Koltunski
 * Do NOT base this on EffectQueue - this is an entirely different animal than the first 3 EffectLists.
9 b3618cb5 Leszek Koltunski
 * The Effects in here will be executed after all the shaders have been executed - thus there are no
10
 * uniforms to send, no real queues to maintain.
11
 * <p>
12
 * Only 2 effects here ATM:
13
 * - save current Surface to a PNG file
14
 * - save current animation to a .MP4 file
15
 *
16
 * In contrast to the other EffectLists, only one instance of each allowed at any given moment - thus
17 d07f2950 Leszek Koltunski
 * this is not even a real EffectQueue, it is named so only for consistency with the others.
18 b3618cb5 Leszek Koltunski
 */
19 d07f2950 Leszek Koltunski
public class EffectQueueOther
20 b3618cb5 Leszek Koltunski
  {
21
  private Vector<EffectListener> mListeners =null;
22
  private int mNumListeners=0;  // ==mListeners.length(), but we only create mListeners if the first one gets added
23
24
///////////////////////////////////////////////////////////////////////////////////////////////////
25
26 d07f2950 Leszek Koltunski
  public EffectQueueOther(DistortedObject obj)
27 b3618cb5 Leszek Koltunski
    {
28
29
    }
30
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32
33
  synchronized void send()
34
    {
35
36
    }
37
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39
40 d07f2950 Leszek Koltunski
  synchronized int abortAll()
41 b3618cb5 Leszek Koltunski
    {
42
43 d07f2950 Leszek Koltunski
    return 0;
44 b3618cb5 Leszek Koltunski
    }
45
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47
48
  void addListener(EffectListener el)
49
    {
50
    if( mListeners==null ) mListeners = new Vector<>(2,2);
51
52
    mListeners.add(el);
53
    mNumListeners++;
54
    }
55
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57
58
  void removeListener(EffectListener el)
59
    {
60
    if( mNumListeners>0 )
61
      {
62
      mListeners.remove(el);
63
      mNumListeners--;
64
      }
65
    }
66
67
///////////////////////////////////////////////////////////////////////////////////////////////////
68
69
  synchronized boolean removeByID(long id)
70
    {
71
    //....
72
73
    return false;
74
    }
75
76
///////////////////////////////////////////////////////////////////////////////////////////////////
77
78
  synchronized boolean removeByType(EffectNames effect)
79
    {
80
    // ...
81
82
    return false;
83
    }
84
85
///////////////////////////////////////////////////////////////////////////////////////////////////
86
87
  protected boolean printByID(long id)
88
    {
89
    return false;
90
    }
91
92
///////////////////////////////////////////////////////////////////////////////////////////////////
93
94
  synchronized long add(EffectNames eln, String filename)
95
    {
96
    return 0;
97
    }
98
  }