invada-studio-plugins-lv2-1.2.0/0000775000175000017500000000000011251515772016331 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/rdf/0000775000175000017500000000000011251515772017104 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/rdf/inv_meter.ttl0000664000175000017500000003122511251515772021624 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 9 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 12 ; ],[ uiext:plugin ; uiext:portIndex 13 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ],[ uiext:plugin ; uiext:portIndex 17 ; ],[ uiext:plugin ; uiext:portIndex 18 ; ],[ uiext:plugin ; uiext:portIndex 19 ; ],[ uiext:plugin ; uiext:portIndex 20 ; ],[ uiext:plugin ; uiext:portIndex 21 ; ],[ uiext:plugin ; uiext:portIndex 22 ; ],[ uiext:plugin ; uiext:portIndex 23 ; ],[ uiext:plugin ; uiext:portIndex 24 ; ],[ uiext:plugin ; uiext:portIndex 25 ; ],[ uiext:plugin ; uiext:portIndex 26 ; ],[ uiext:plugin ; uiext:portIndex 27 ; ],[ uiext:plugin ; uiext:portIndex 28 ; ],[ uiext:plugin ; uiext:portIndex 29 ; ],[ uiext:plugin ; uiext:portIndex 30 ; ],[ uiext:plugin ; uiext:portIndex 31 ; ],[ uiext:plugin ; uiext:portIndex 32 ; ],[ uiext:plugin ; uiext:portIndex 33 ; ],[ uiext:plugin ; uiext:portIndex 34 ; ],[ uiext:plugin ; uiext:portIndex 35 ; ],[ uiext:plugin ; uiext:portIndex 36 ; ],[ uiext:plugin ; uiext:portIndex 37 ; ],[ uiext:plugin ; uiext:portIndex 38 ; ],[ uiext:plugin ; uiext:portIndex 39 ; ],[ uiext:plugin ; uiext:portIndex 40 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:AnalyserPlugin ; doap:name "Invada Meter" ; doap:license ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 1 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 2 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 3 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 4 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterL" ; lv2:name "Meter L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "meterR" ; lv2:name "Meter R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "vuL" ; lv2:name "Meter L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "vuR" ; lv2:name "Meter R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "meterPhase" ; lv2:name "Phase Meter" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.57079632675 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "spec20" ; lv2:name "20Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "spec25" ; lv2:name "25Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "spec31" ; lv2:name "31Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 13 ; lv2:symbol "spec40" ; lv2:name "40Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "spec50" ; lv2:name "50Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "spec63" ; lv2:name "63Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "spec80" ; lv2:name "80Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 17 ; lv2:symbol "spec100" ; lv2:name "100Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 18 ; lv2:symbol "spec125" ; lv2:name "125Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 19 ; lv2:symbol "spec160" ; lv2:name "160Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 20 ; lv2:symbol "spec200" ; lv2:name "200Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 21 ; lv2:symbol "spec250" ; lv2:name "250Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 22 ; lv2:symbol "spec315" ; lv2:name "315Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 23 ; lv2:symbol "spec400" ; lv2:name "400Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 24 ; lv2:symbol "spec500" ; lv2:name "500Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 25 ; lv2:symbol "spec630" ; lv2:name "630Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 26 ; lv2:symbol "spec800" ; lv2:name "800Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 27 ; lv2:symbol "spec1000" ; lv2:name "1kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 28 ; lv2:symbol "spec1250" ; lv2:name "1.25kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 29 ; lv2:symbol "spec1600" ; lv2:name "1.6kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 30 ; lv2:symbol "spec2000" ; lv2:name "2kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 31 ; lv2:symbol "spec2500" ; lv2:name "2.5Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 32 ; lv2:symbol "spec3150" ; lv2:name "3.15Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 33 ; lv2:symbol "spec4000" ; lv2:name "4Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 34 ; lv2:symbol "spec5000" ; lv2:name "5kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 35 ; lv2:symbol "spec6300" ; lv2:name "6.3kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 36 ; lv2:symbol "spec8000" ; lv2:name "8Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 37 ; lv2:symbol "spec10000" ; lv2:name "10Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 38 ; lv2:symbol "spec12500" ; lv2:name "12.5Hz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 39 ; lv2:symbol "spec16000" ; lv2:name "16kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 40 ; lv2:symbol "spec20000" ; lv2:name "20kHz" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_testtone.ttl0000664000175000017500000000441711251515772022360 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 4 ; ] . a lv2:Plugin, lv2:OscillatorPlugin ; doap:name "Invada Test Tones" ; doap:license ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "active" ; lv2:name "Active" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "frequency" ; lv2:name "Frequency" ; lv2:default 1000.0 ; lv2:minimum 20.0 ; lv2:maximum 20000.0 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "trim" ; lv2:name "Trim" ; lv2:default 0.0 ; lv2:minimum -24.0 ; lv2:maximum 0.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 3 ; lv2:symbol "out" ; lv2:name "Out" ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "meterOut" ; lv2:name "Out Meter" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_phaser.ttl0000664000175000017500000003365011251515772021776 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 12 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 12 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 12 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:PhaserPlugin ; doap:name "Invada Stereo Phaser (mono in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "cycle" ; lv2:name "Period" ; lv2:default 25 ; lv2:minimum 0.5 ; lv2:maximum 500 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "phase" ; lv2:name "Phase Offset" ; lv2:default 45 ; lv2:minimum -180 ; lv2:maximum 180 ; units:unit units:degree ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "width" ; lv2:name "Width" ; lv2:default 8.0 ; lv2:minimum 1.0 ; lv2:maximum 15.0 ; units:unit units:ms ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "depth" ; lv2:name "Depth" ; lv2:default 75.01 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 1.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "lampDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "lampL" ; lv2:name "LFO L Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampR" ; lv2:name "LFO R Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 10 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:PhaserPlugin ; doap:name "Invada Stereo Phaser (stereo in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "cycle" ; lv2:name "Period" ; lv2:default 25 ; lv2:minimum 0.5 ; lv2:maximum 500 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "phase" ; lv2:name "Phase Offset" ; lv2:default 45 ; lv2:minimum -180 ; lv2:maximum 180 ; units:unit units:degree ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "width" ; lv2:name "Width" ; lv2:default 8.0 ; lv2:minimum 1.0 ; lv2:maximum 15.0 ; units:unit units:ms ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "depth" ; lv2:name "Depth" ; lv2:default 75.01 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 1.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "lampDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "lampL" ; lv2:name "LFO L Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampR" ; lv2:name "LFO R Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 10 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "inL" ; lv2:name "InL" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterInL" ; lv2:name "In L" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 15 ; lv2:symbol "inR" ; lv2:name "In R" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "meterInR" ; lv2:name "In R" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:PhaserPlugin ; doap:name "Invada Stereo Phaser (sum L+R in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "cycle" ; lv2:name "Period" ; lv2:default 25 ; lv2:minimum 0.5 ; lv2:maximum 500 ; units:unit units:s ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "phase" ; lv2:name "Phase Offset" ; lv2:default 45 ; lv2:minimum -180 ; lv2:maximum 180 ; units:unit units:degree ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "width" ; lv2:name "Width" ; lv2:default 8.0 ; lv2:minimum 1.0 ; lv2:maximum 15.0 ; units:unit units:ms ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "depth" ; lv2:name "Depth" ; lv2:default 75.01 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 1.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "lampDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "lampL" ; lv2:name "LFO L Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampR" ; lv2:name "LFO R Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 10 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "inL" ; lv2:name "In L" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 15 ; lv2:symbol "inR" ; lv2:name "In R" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_input.ttl0000664000175000017500000001235611251515772021653 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix dc: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 12 ; ],[ uiext:plugin ; uiext:portIndex 13 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:UtilityPlugin ; doap:name "Invada Input Module" ; doap:license ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "phaseL" ; lv2:name "Phase (L)" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "phaseR" ; lv2:name "Phase (R)" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum -24.0 ; lv2:maximum 24.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "pan" ; lv2:name "Pan" ; lv2:default 0.0 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "width" ; lv2:name "Stereo Width" ; lv2:default 0.0 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 7 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 8 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 10 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterInL" ; lv2:name "L In Meter" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "meterInR" ; lv2:name "R In Meter" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 13 ; lv2:symbol "meterOutL" ; lv2:name "L Out Meter" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterOutR" ; lv2:name "R Out Meter" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterPhase" ; lv2:name "Phase Meter" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.57079632675 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "lampDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_erreverb.ttl0000664000175000017500000002274611251515772022334 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix dc: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:ReverbPlugin ; doap:name "Invada Early Reflection Reverb (mono in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "roomLength" ; lv2:name "Room Length" ; lv2:default 25 ; lv2:minimum 3 ; lv2:maximum 100 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "roomWidth" ; lv2:name "Room Width" ; lv2:default 30 ; lv2:minimum 3 ; lv2:maximum 100 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "roomHeight" ; lv2:name "Room Height" ; lv2:default 10 ; lv2:minimum 3 ; lv2:maximum 30 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "sourceLR" ; lv2:name "Source Pan" ; lv2:default -0.01 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "sourceFB" ; lv2:name "Source (F/B)" ; lv2:default 0.8 ; lv2:minimum 0.5 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "listLR" ; lv2:name "Listener Pan" ; lv2:default 0.01 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "listFB" ; lv2:name "Listener (F/B)" ; lv2:default 0.2 ; lv2:minimum 0.0 ; lv2:maximum 0.5 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "hpf" ; lv2:name "HPF" ; lv2:default 1000.0 ; lv2:minimum 20.0 ; lv2:maximum 2000.0 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "warmth" ; lv2:name "Warmth" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "diffusion" ; lv2:name "Diffusion" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 11 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:ReverbPlugin ; doap:name "Invada Early Reflection Reverb (sum L+R in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "roomLength" ; lv2:name "Room Length" ; lv2:default 25 ; lv2:minimum 3 ; lv2:maximum 100 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "roomWidth" ; lv2:name "Room Width" ; lv2:default 30 ; lv2:minimum 3 ; lv2:maximum 100 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "roomHeight" ; lv2:name "Room Height" ; lv2:default 10 ; lv2:minimum 3 ; lv2:maximum 30 ; units:unit units:m ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "sourceLR" ; lv2:name "Source Pan" ; lv2:default -0.01 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "sourceFB" ; lv2:name "Source (F/B)" ; lv2:default 0.8 ; lv2:minimum 0.5 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "listLR" ; lv2:name "Listener Pan" ; lv2:default 0.01 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "listFB" ; lv2:name "Listener (F/B)" ; lv2:default 0.2 ; lv2:minimum 0.0 ; lv2:maximum 0.5 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "hpf" ; lv2:name "HPF" ; lv2:default 1000.0 ; lv2:minimum 20.0 ; lv2:maximum 2000.0 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "warmth" ; lv2:name "Warmth" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "diffusion" ; lv2:name "Diffusion" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 11 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 17 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_filter.ttl0000664000175000017500000003324411251515772022000 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix dc: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 4 ; ],[ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 4 ; ],[ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 4 ; ],[ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 9 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 4 ; ],[ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 9 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ] . a lv2:Plugin, lv2:LowpassPlugin ; doap:name "Invada Low Pass Filter (mono)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "freq" ; lv2:name "Frequency" ; lv2:default 1000 ; lv2:minimum 20 ; lv2:maximum 20000 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterOut" ; lv2:name "Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 6 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 7 ; lv2:symbol "out" ; lv2:name "Out" ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:LowpassPlugin ; doap:name "Invada Low Pass Filter (stereo)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "freq" ; lv2:name "Frequency" ; lv2:default 1000 ; lv2:minimum 20 ; lv2:maximum 20000 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "meterInL" ; lv2:name "L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 6 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 7 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "meterInR" ; lv2:name "R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 11 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] . a lv2:Plugin, lv2:HighpassPlugin ; doap:name "Invada High Pass Filter (mono)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "freq" ; lv2:name "Frequency" ; lv2:default 1000 ; lv2:minimum 20 ; lv2:maximum 20000 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterOut" ; lv2:name "Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 6 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 7 ; lv2:symbol "out" ; lv2:name "Out" ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:HighpassPlugin ; doap:name "Invada High Pass Filter (stereo)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "freq" ; lv2:name "Frequency" ; lv2:default 1000 ; lv2:minimum 20 ; lv2:maximum 20000 ; units:unit units:hz ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 12.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "meterInL" ; lv2:name "L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 6 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 7 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "meterInR" ; lv2:name "R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 11 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_tube.ttl0000664000175000017500000001643211251515772021452 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix dc: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 5 ; ],[ uiext:plugin ; uiext:portIndex 6 ; ],[ uiext:plugin ; uiext:portIndex 7 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ] . a lv2:Plugin, lv2:DistortionPlugin ; doap:name "Invada Tube Distortion (mono)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "drive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 18.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "dcoffset" ; lv2:name "DC Offset" ; lv2:default 0.0 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "phase" ; lv2:name "Tube Phase" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "mix" ; lv2:name "Mix" ; lv2:default 75.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "meterOut" ; lv2:name "Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 8 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "out" ; lv2:name "Out" ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:DistortionPlugin ; doap:name "Invada Tube Distortion (stereo)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "drive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 18.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "dcoffset" ; lv2:name "DC Offset" ; lv2:default 0.0 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "phase" ; lv2:name "Tube Phase" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "mix" ; lv2:name "Mix" ; lv2:default 75.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "meterDrive" ; lv2:name "Drive Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "meterInL" ; lv2:name "L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 8 ; lv2:symbol "inL" ; lv2:name "L In" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 9 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "meterInR" ; lv2:name "R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "inR" ; lv2:name "R In" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_delay.ttl0000664000175000017500000002616111251515772021611 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ],[ uiext:plugin ; uiext:portIndex 17 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ],[ uiext:plugin ; uiext:portIndex 16 ; ],[ uiext:plugin ; uiext:portIndex 17 ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:DelayPlugin ; doap:name "Invada Delay Munge (mono in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "mode" ; lv2:name "Mode" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "mungemode" ; lv2:name "Munge Mode" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "munge" ; lv2:name "Munge" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "LFOcycle" ; lv2:name "LFO" ; lv2:default 20.0 ; lv2:minimum 2.0 ; lv2:maximum 200.0 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "LFOdepth" ; lv2:name "Depth" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "delay1" ; lv2:name "Delay 1" ; lv2:default 0.3 ; lv2:minimum 0.02 ; lv2:maximum 2 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "fb1" ; lv2:name "Feedback 1" ; lv2:default 50.0 ; lv2:minimum 0 ; lv2:maximum 133.3333333333 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "pan1" ; lv2:name "Pan 1" ; lv2:default -0.7 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "vol1" ; lv2:name "Volume 1" ; lv2:default 100.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "delay2" ; lv2:name "Delay 2" ; lv2:default 0.2 ; lv2:minimum 0.02 ; lv2:maximum 2 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "fb2" ; lv2:name "Feedback 2" ; lv2:default 50.0 ; lv2:minimum 0 ; lv2:maximum 133.3333333333 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "pan2" ; lv2:name "Pan 2" ; lv2:default 0.7 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 13 ; lv2:symbol "vol2" ; lv2:name "Volume 2" ; lv2:default 100.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 17 ; lv2:symbol "LFOlamp" ; lv2:name "LFO Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 18 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 19 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 20 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:DelayPlugin ; doap:name "Invada Delay Munge (sum L+R in)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "mode" ; lv2:name "Mode" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "mungemode" ; lv2:name "Munge Mode" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "munge" ; lv2:name "Munge" ; lv2:default 50.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "LFOcycle" ; lv2:name "LFO" ; lv2:default 20.0 ; lv2:minimum 2.0 ; lv2:maximum 200.0 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "LFOdepth" ; lv2:name "Depth" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "delay1" ; lv2:name "Delay 1" ; lv2:default 0.3 ; lv2:minimum 0.02 ; lv2:maximum 2 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "fb1" ; lv2:name "Feedback 1" ; lv2:default 50.0 ; lv2:minimum 0 ; lv2:maximum 133.3333333333 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "pan1" ; lv2:name "Pan 1" ; lv2:default -0.7 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "vol1" ; lv2:name "Volume 1" ; lv2:default 100.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "delay2" ; lv2:name "Delay 2" ; lv2:default 0.2 ; lv2:minimum 0.02 ; lv2:maximum 2 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "fb2" ; lv2:name "Feedback 2" ; lv2:default 50.0 ; lv2:minimum 0 ; lv2:maximum 133.3333333333 ; units:unit units:pc ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 12 ; lv2:symbol "pan2" ; lv2:name "Pan 2" ; lv2:default 0.7 ; lv2:minimum -1.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 13 ; lv2:symbol "vol2" ; lv2:name "Volume 2" ; lv2:default 100.0 ; lv2:minimum 0.0 ; lv2:maximum 100.0 ; units:unit units:pc ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 16 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 17 ; lv2:symbol "LFOlamp" ; lv2:name "LFO Lamp" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 4.0 ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 18 ; lv2:symbol "inL" ; lv2:name "In L" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 19 ; lv2:symbol "outL" ; lv2:name "L Out" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 20 ; lv2:symbol "outR" ; lv2:name "R Out" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 21 ; lv2:symbol "inR" ; lv2:name "In R" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/inv_compressor.ttl0000664000175000017500000002241411251515772022704 0ustar alessioalessio@prefix lv2: . @prefix foaf: . @prefix doap: . @prefix rdfs: . @prefix units: . @prefix uiext: . @prefix epp: . @prefix dc: . @prefix pg: . a uiext:GtkUI; uiext:binary ; uiext:requiredFeature uiext:makeResident ; uiext:optionalFeature uiext:noUserResize ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 9 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ] ; uiext:portNotification [ uiext:plugin ; uiext:portIndex 8 ; ],[ uiext:plugin ; uiext:portIndex 9 ; ],[ uiext:plugin ; uiext:portIndex 10 ; ],[ uiext:plugin ; uiext:portIndex 11 ; ],[ uiext:plugin ; uiext:portIndex 14 ; ],[ uiext:plugin ; uiext:portIndex 15 ; ] . a lv2:Plugin, lv2:CompressorPlugin ; doap:name "Invada Compressor (mono)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "rms" ; lv2:name "RMS" ; lv2:default 0.5 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "attack" ; lv2:name "Attack" ; lv2:default 0.015 ; lv2:minimum 0.00001 ; lv2:maximum 0.750 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "release" ; lv2:name "Release" ; lv2:default 0.050 ; lv2:minimum 0.001 ; lv2:maximum 5.0 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "threshold" ; lv2:name "Threshold" ; lv2:default 0.0 ; lv2:minimum -36.0 ; lv2:maximum 0.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "ratio" ; lv2:name "Ratio" ; lv2:default 1.0 ; lv2:minimum 1.0 ; lv2:maximum 20.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum -6.0 ; lv2:maximum 36.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 1.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "grmeter" ; lv2:name "Gain Reduction" ; lv2:default 0.0 ; lv2:minimum -36.0 ; lv2:maximum 0.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "meterIn" ; lv2:name "In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOut" ; lv2:name "Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "in" ; lv2:name "In" ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "out" ; lv2:name "Out" ; ] . a pg:Group ; a pg:StereoGroup ; lv2:symbol "in" . a pg:Group ; a pg:StereoGroup ; lv2:symbol "out" . a lv2:Plugin, lv2:CompressorPlugin ; doap:name "Invada Compressor (stereo)" ; doap:developer [ foaf:name "Fraser Stuart"; foaf:homepage ; foaf:mbox ; ] ; doap:maintainer [ foaf:name "Invada"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; lv2:optionalFeature lv2:hardRtCapable ; uiext:ui ; dc:replaces ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; lv2:index 0 ; lv2:symbol "bypass" ; lv2:name "Bypass" ; lv2:portProperty lv2:toggled ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 1 ; lv2:symbol "rms" ; lv2:name "RMS" ; lv2:default 0.5 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 2 ; lv2:symbol "attack" ; lv2:name "Attack" ; lv2:default 0.015 ; lv2:minimum 0.00001 ; lv2:maximum 0.750 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 3 ; lv2:symbol "release" ; lv2:name "Release" ; lv2:default 0.050 ; lv2:minimum 0.001 ; lv2:maximum 5.0 ; units:unit units:s ; lv2:portProperty epp:logarithmic ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 4 ; lv2:symbol "threshold" ; lv2:name "Threshold" ; lv2:default 0.0 ; lv2:minimum -36.0 ; lv2:maximum 0.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 5 ; lv2:symbol "ratio" ; lv2:name "Ratio" ; lv2:default 1.0 ; lv2:minimum 1.0 ; lv2:maximum 20.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 6 ; lv2:symbol "gain" ; lv2:name "Gain" ; lv2:default 0.0 ; lv2:minimum -6.0 ; lv2:maximum 36.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:ControlPort ; lv2:index 7 ; lv2:symbol "noClip" ; lv2:name "Soft Clip" ; lv2:portProperty lv2:toggled ; lv2:default 1.0 ; lv2:minimum 0.0 ; lv2:maximum 1.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; lv2:symbol "grmeter" ; lv2:name "Gain Reduction" ; lv2:default 0.0 ; lv2:minimum -36.0 ; lv2:maximum 0.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 9 ; lv2:symbol "lampDrive" ; lv2:name "Drive" ; lv2:default 0.0 ; lv2:minimum 0.0 ; lv2:maximum 10.0 ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 10 ; lv2:symbol "meterInL" ; lv2:name "L In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 11 ; lv2:symbol "meterOutL" ; lv2:name "L Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 12 ; lv2:symbol "inL" ; lv2:name "In L" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 13 ; lv2:symbol "outL" ; lv2:name "Out L" ; pg:inGroup ; pg:role pg:leftChannel ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 14 ; lv2:symbol "meterInR" ; lv2:name "R In" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:OutputPort, lv2:ControlPort ; lv2:index 15 ; lv2:symbol "meterOutR" ; lv2:name "R Out" ; lv2:default -60.0 ; lv2:minimum -60.0 ; lv2:maximum 6.0 ; units:unit units:db ; ] , [ a lv2:InputPort, lv2:AudioPort ; lv2:index 16 ; lv2:symbol "inR" ; lv2:name "In R" ; pg:inGroup ; pg:role pg:rightChannel ; ] , [ a lv2:OutputPort, lv2:AudioPort ; lv2:index 17 ; lv2:symbol "outR" ; lv2:name "Out R" ; pg:inGroup ; pg:role pg:rightChannel ; ] . invada-studio-plugins-lv2-1.2.0/rdf/manifest.ttl0000664000175000017500000000744511251515772021451 0ustar alessioalessio@prefix lv2: . @prefix rdfs: . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . a lv2:Plugin ; lv2:binary ; rdfs:seeAlso . invada-studio-plugins-lv2-1.2.0/README0000664000175000017500000000663211251515772017220 0ustar alessioalessioINTRODUCTION ============ Thanks for taking the time to try out these plugins. Feedback / comments welcome. CONTENTS ======== The following plugins are included: Delay Plugins * Delay Munge - Mono => Two channel delay with non-linear feedback (munged) plus delay calculator. * Delay Munge - Stereo => Two channel delay with non-linear feedback (munged) plus delay calculator. Distortion Plugins * Tube - Mono => Valve warmth/distortion simulation * Tube - Stereo => Valve warmth/distortion simulation Dynamics Plugins * Compressor - Mono => Peak/RMS softclipping compressor * Compressor - Stereo => Peak/RMS softclipping compressor Filter Plugins * Low Pass Mono => gentle low pass filter * Low Pass Stereo => gentle low pass filter * High Pass Mono => gentle high pass filter * High Pass Stereo => gentle high pass filter Phaser Plugins * Stereo Phaser - Mono In => slow stereo phaser * Stereo Phaser - Stereo In => slow stereo phaser * Stereo Phaser - Sum L+R In => slow stereo phaser Reverb Plugins * ER Reverb - Mono In => early reflection based reverb * ER Reverb - Sum L+R In => early reflection based reverb Utility Plugins * Input Module => alter gain, balance, width, phase on a stereo signal * Meters => peak, VU, phase and spectrograph meters * Test Tones => Generate test tones at standard and muscial frequencies. INSTALLATION ============ No binaries are included, you'll need to compile the plugins yourself. BUILDING ======== To build the plugins the you'll need the following items installed: * a working build environment with core includes * the lv2 header file (lv2.h) * the gtk2 developer libraries & includes * the cairo developer libraries & includes * the glade2 developer libraries & includes Go to the directory that was created when you unpacked this archive and then run: make make install-user (to install in ~/.lv2) or make install-sys (as root to install in /usr/local/lib/lv2) Change the Makefile if you'd like to have them in an alternate system location. BUILDING (Debian and derivatives) ================================= Packages for Debian and derivatives (Ubuntu etc) can be built from this archive. You'll need a Debian build environment. To install the build environment and dependancies run the following: sudo apt-get install build-essential debhelper fakeroot lv2core libgtk2.0-dev Go to the directory that was created when you unpacked this archive and then run: dpkg-buildpackage -rfakeroot -tc Once done you'll find a 'deb' package for your system in the directory above. Use your favourite package manager to install. The plugins will install into "/usr" by default. PACKAGES (Ubuntu and derivatives) ================================= Pre built binary packagaes for ubuntu are available from https://launchpad.net/~invada/+archive/ppa PACKAGING FOR DISTROS ================================= An alternative download is available at launchpad which has no 'debian' packaging information in it. Look for the 'nopkg' tarball. When building in fakeroot type environments, the installation directory can be prefixed with a destination directory like so: make install-sys DESTDIR='/a/fake/root/location' which will install into /a/fake/root/location/usr/local/lib/lv2 Enjoy! fraser@arkhostings.com https://launchpad.net/invada-studio invada-studio-plugins-lv2-1.2.0/plugingui/0000775000175000017500000000000011251515772020334 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/plugingui/inv_erreverb_gui.c0000664000175000017500000005643511251515772024051 0ustar alessioalessio/* This LV2 extension provides er reverb gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/display-ErReverb.h" #include "widgets/knob.h" #include "widgets/meter-peak.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_erreverb.h" #include "inv_erreverb_gui.h" static LV2UI_Descriptor *IErReverbGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *display; GtkWidget *knobLength; GtkWidget *knobWidth; GtkWidget *knobHeight; GtkWidget *knobHPF; GtkWidget *knobWarmth; GtkWidget *knobDiffusion; gint InChannels; gint OutChannels; float bypass; float length; float width; float height; float sourceLR; float sourceFB; float destLR; float destFB; float hpf; float warmth; float diffusion; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IErReverbGui; static LV2UI_Handle instantiateIErReverbGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IErReverbGui *pluginGui = (IErReverbGui *)malloc(sizeof(IErReverbGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_erreverb_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "erreverb_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "erreverb_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_erreverb_display")); pluginGui->display = inv_display_err_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->display); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_length_knob")); pluginGui->knobLength = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobLength); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_width_knob")); pluginGui->knobWidth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobWidth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_height_knob")); pluginGui->knobHeight = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobHeight); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_hpf_knob")); pluginGui->knobHPF = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobHPF); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_warmth_knob")); pluginGui->knobWarmth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobWarmth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_diffusion_knob")); pluginGui->knobDiffusion = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDiffusion); /* customise for the plugin */ if(!strcmp(plugin_uri,IERR_MONO_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Early Reflection Reverb (mono in)"); } if(!strcmp(plugin_uri,IERR_SUM_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Early Reflection Reverb (sum L+R in)"); } pluginGui->InChannels = 1; pluginGui->OutChannels = 2; pluginGui->bypass = 0.0; pluginGui->length = 25.0; pluginGui->width = 30.0; pluginGui->height = 10.0; pluginGui->sourceLR =-0.01; pluginGui->sourceFB = 0.8; pluginGui->destLR = 0.01; pluginGui->destFB = 0.2; pluginGui->hpf = 1000.0; pluginGui->warmth = 50.0; pluginGui->diffusion = 50.0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_erreverb_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_display_err_set_bypass(INV_DISPLAY_ERR (pluginGui->display), INV_PLUGIN_ACTIVE); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_LENGTH, pluginGui->length); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_WIDTH, pluginGui->width); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_HEIGHT, pluginGui->height); inv_display_err_set_source(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_LR, pluginGui->sourceLR); inv_display_err_set_source(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_FB, pluginGui->sourceFB); inv_display_err_set_dest(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_LR, pluginGui->destLR); inv_display_err_set_dest(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_FB, pluginGui->destFB); inv_display_err_set_diffusion(INV_DISPLAY_ERR (pluginGui->display), pluginGui->diffusion); g_signal_connect_after(G_OBJECT(pluginGui->display),"motion-notify-event",G_CALLBACK(on_inv_erreverb_display_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobLength), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobLength), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobLength), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobLength), INV_KNOB_MARKINGS_4); inv_knob_set_units(INV_KNOB (pluginGui->knobLength), "m"); inv_knob_set_min(INV_KNOB (pluginGui->knobLength), 3.0); inv_knob_set_max(INV_KNOB (pluginGui->knobLength), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobLength), pluginGui->length); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobLength), "Description: This knob sets the length of the virtual room.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobLength),"motion-notify-event",G_CALLBACK(on_inv_erreverb_length_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobWidth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobWidth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobWidth), INV_KNOB_MARKINGS_4); inv_knob_set_units(INV_KNOB (pluginGui->knobWidth), "m"); inv_knob_set_min(INV_KNOB (pluginGui->knobWidth), 3.0); inv_knob_set_max(INV_KNOB (pluginGui->knobWidth), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->length); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobWidth), "Description: This knob sets the width of the virtual room.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobWidth),"motion-notify-event",G_CALLBACK(on_inv_erreverb_width_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobHeight), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobHeight), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobHeight), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobHeight), INV_KNOB_MARKINGS_4); inv_knob_set_units(INV_KNOB (pluginGui->knobHeight), "m"); inv_knob_set_min(INV_KNOB (pluginGui->knobHeight), 3.0); inv_knob_set_max(INV_KNOB (pluginGui->knobHeight), 30.0); inv_knob_set_value(INV_KNOB (pluginGui->knobHeight), pluginGui->length); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobHeight), "Description: This knob sets the height of the virtual room.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobHeight),"motion-notify-event",G_CALLBACK(on_inv_erreverb_height_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobHPF), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobHPF), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobHPF), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobHPF), INV_KNOB_MARKINGS_3); inv_knob_set_human(INV_KNOB (pluginGui->knobHPF)); inv_knob_set_units(INV_KNOB (pluginGui->knobHPF), "Hz"); inv_knob_set_min(INV_KNOB (pluginGui->knobHPF), 20.0); inv_knob_set_max(INV_KNOB (pluginGui->knobHPF), 2000.0); inv_knob_set_value(INV_KNOB (pluginGui->knobHPF), pluginGui->hpf); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobHPF), "Description: This knob rolls off bottom end as it tends to make reverbs sound muddy.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobHPF),"motion-notify-event",G_CALLBACK(on_inv_erreverb_hpf_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobWarmth), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobWarmth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobWarmth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobWarmth), INV_KNOB_MARKINGS_5); inv_knob_set_units(INV_KNOB (pluginGui->knobWarmth), "%"); inv_knob_set_min(INV_KNOB (pluginGui->knobWarmth), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobWarmth), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobWarmth), pluginGui->warmth); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobWarmth), "Description: This knob sets the high frequency loss of reflections within the room. Low values have little loss (like a tiled room). High values have a lot of loss.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobWarmth),"motion-notify-event",G_CALLBACK(on_inv_erreverb_warmth_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDiffusion), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobDiffusion), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobDiffusion), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobDiffusion), INV_KNOB_MARKINGS_5); inv_knob_set_units(INV_KNOB (pluginGui->knobDiffusion), "%"); inv_knob_set_min(INV_KNOB (pluginGui->knobDiffusion), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobDiffusion), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobDiffusion), pluginGui->diffusion); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobDiffusion), "Description: This knob sets the scattering of reflections which simulates rough or uneven surfaces within the virtual room.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDiffusion),"motion-notify-event",G_CALLBACK(on_inv_erreverb_diffusion_knob_motion),pluginGui); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIErReverbGui(LV2UI_Handle ui) { return; } static void port_eventIErReverbGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IErReverbGui *pluginGui = (IErReverbGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IERR_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_display_err_set_bypass( INV_DISPLAY_ERR (pluginGui->display), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobLength), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobHeight), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobHPF), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWarmth), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDiffusion), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_display_err_set_bypass( INV_DISPLAY_ERR (pluginGui->display), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobLength), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobHeight), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobHPF), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWarmth), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDiffusion), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IERR_ROOMLENGTH: pluginGui->length=value; inv_knob_set_value(INV_KNOB (pluginGui->knobLength), pluginGui->length); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_LENGTH, pluginGui->length); gtk_widget_queue_draw (pluginGui->display); break; case IERR_ROOMWIDTH: pluginGui->width=value; inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_WIDTH, pluginGui->width); gtk_widget_queue_draw (pluginGui->display); break; case IERR_ROOMHEIGHT: pluginGui->height=value; inv_knob_set_value(INV_KNOB (pluginGui->knobHeight), pluginGui->height); inv_display_err_set_room(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_ROOM_HEIGHT, pluginGui->height); gtk_widget_queue_draw (pluginGui->display); break; case IERR_SOURCELR: pluginGui->sourceLR=value; inv_display_err_set_source(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_LR, pluginGui->sourceLR); break; case IERR_SOURCEFB: pluginGui->sourceFB=value; inv_display_err_set_source(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_FB, pluginGui->sourceFB); break; case IERR_DESTLR: pluginGui->destLR=value; inv_display_err_set_dest(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_LR, pluginGui->destLR); break; case IERR_DESTFB: pluginGui->destFB=value; inv_display_err_set_dest(INV_DISPLAY_ERR (pluginGui->display), INV_DISPLAY_ERR_FB, pluginGui->destFB); break; case IERR_HPF: pluginGui->hpf=value; inv_knob_set_value(INV_KNOB (pluginGui->knobHPF), pluginGui->hpf); break; case IERR_WARMTH: pluginGui->warmth=value; inv_knob_set_value(INV_KNOB (pluginGui->knobWarmth), pluginGui->warmth); break; case IERR_DIFFUSION: pluginGui->diffusion=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDiffusion), pluginGui->diffusion); inv_display_err_set_diffusion(INV_DISPLAY_ERR (pluginGui->display), pluginGui->diffusion); gtk_widget_queue_draw (pluginGui->display); break; case IERR_METER_IN: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case IERR_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case IERR_METER_OUTR: inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; } } } static void init() { IErReverbGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IErReverbGuiDescriptor->URI = IERR_GUI_URI; IErReverbGuiDescriptor->instantiate = instantiateIErReverbGui; IErReverbGuiDescriptor->cleanup = cleanupIErReverbGui; IErReverbGuiDescriptor->port_event = port_eventIErReverbGui; IErReverbGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IErReverbGuiDescriptor) init(); switch (index) { case 0: return IErReverbGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_erreverb_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_erreverb_length_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->length=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_ROOMLENGTH, 4, 0, &pluginGui->length); return; } static void on_inv_erreverb_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->width=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_ROOMWIDTH, 4, 0, &pluginGui->width); return; } static void on_inv_erreverb_height_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->height=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_ROOMHEIGHT, 4, 0, &pluginGui->height); return; } static void on_inv_erreverb_hpf_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->hpf=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_HPF, 4, 0, &pluginGui->hpf); return; } static void on_inv_erreverb_warmth_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->warmth=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_WARMTH, 4, 0, &pluginGui->warmth); return; } static void on_inv_erreverb_diffusion_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IErReverbGui *pluginGui = (IErReverbGui *) data; pluginGui->diffusion=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IERR_DIFFUSION, 4, 0, &pluginGui->diffusion); return; } static void on_inv_erreverb_display_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { gint active_dot; IErReverbGui *pluginGui = (IErReverbGui *) data; active_dot=inv_display_err_get_active_dot(INV_DISPLAY_ERR (widget)); switch(active_dot) { case INV_DISPLAY_ERR_DOT_SOURCE: pluginGui->sourceLR=inv_display_err_get_source(INV_DISPLAY_ERR (widget), INV_DISPLAY_ERR_LR); pluginGui->sourceFB=inv_display_err_get_source(INV_DISPLAY_ERR (widget), INV_DISPLAY_ERR_FB); (*pluginGui->write_function)(pluginGui->controller, IERR_SOURCELR, 4, 0, &pluginGui->sourceLR); (*pluginGui->write_function)(pluginGui->controller, IERR_SOURCEFB, 4, 0, &pluginGui->sourceFB); break; case INV_DISPLAY_ERR_DOT_DEST: pluginGui->destLR=inv_display_err_get_dest(INV_DISPLAY_ERR (widget), INV_DISPLAY_ERR_LR); pluginGui->destFB=inv_display_err_get_dest(INV_DISPLAY_ERR (widget), INV_DISPLAY_ERR_FB); (*pluginGui->write_function)(pluginGui->controller, IERR_DESTLR, 4, 0, &pluginGui->destLR); (*pluginGui->write_function)(pluginGui->controller, IERR_DESTFB, 4, 0, &pluginGui->destFB); break; } return; } invada-studio-plugins-lv2-1.2.0/plugingui/gtk/0000775000175000017500000000000011251515772021121 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_input_gui.glade0000664000175000017500000005637311251515772025014 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Input Module</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True label_item False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Phase True label_item False False 2 True 2 6 6 6 True 1 5 2 True 0.5 True 0 0 True True 0 0 4 8 4 4 True 0 0 8 4 4 4 1 True Soft Clip True label_item 4 5 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Gain True label_item 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Pan True label_item 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 8 4 4 True 0 0 8 4 4 4 1 True Phase True label_item GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Width True label_item 3 4 GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_erreverb_gui.xml0000664000175000017500000006160411251515772025206 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Invada ER Reverb</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 2 True Audio In GTK_JUSTIFY_RIGHT 4 True Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Reverb Response 2 True 2 6 6 6 True 1 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True HPF True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Warmth True 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Diffusion True 2 2 True Reverb True 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Length True 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Width True 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Height True 2 2 True Room Size True GTK_JUSTIFY_RIGHT GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_phaser_gui.xml0000664000175000017500000005715611251515772024663 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Phaser</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0 0 1 2 1 2 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True Levels True False False 1 True 2 6 6 6 True 1 4 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Width True 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Period True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True L/R Phase True 1 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 False False 2 True LFO True GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Depth True 2 3 GTK_EXPAND GTK_FILL 2 2 False False 2 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_phaser_gui.glade0000664000175000017500000006117111251515772025127 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Phaser</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0 0 1 2 1 2 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True Levels True label_item False False 1 True 2 6 6 6 True 1 4 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True label_item 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Width True label_item 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Period True label_item True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True L/R Phase True label_item 1 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 False False 2 True LFO True label_item GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Depth True label_item 2 3 GTK_EXPAND GTK_FILL 2 2 False False 2 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_filter_gui.xml0000664000175000017500000004200111251515772024645 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Filter</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 2 True 0 0 1 2 1 2 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True Levels True False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Frequency Response 2 True 2 6 6 6 True 1 3 2 True 0.5 True 0 0 4 4 4 4 True Frequency True GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Gain True 1 2 GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_compressor_gui.xml0000664000175000017500000007373511251515772025576 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Invada Compressor</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 3 True Audio In GTK_JUSTIFY_RIGHT 4 True Gain Reduction GTK_JUSTIFY_RIGHT 4 1 2 True Audio Out GTK_JUSTIFY_RIGHT 5 2 3 True 0 0 1 2 True 0 0 1 2 1 2 True 0 0 2 3 1 2 True Levels True False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Compressor Response 2 True 2 6 6 6 True 1 4 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Threshold True 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Ratio True 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Makeup Gain True 2 2 True Compressor True 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Attack True 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Release True 2 1 True Envelope True GTK_JUSTIFY_RIGHT 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 22 4 4 4 True Detector True GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_meter_gui.xml0000664000175000017500000004215111251515772024502 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Meters</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Peak True False False 1 True 2 6 6 6 True 0 True True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True 0 0 4 4 True 9 True VU 0dB: False False True True -15dB True True radio9db False False 1 True True -12dB True True radio9db False False 2 True True -9dB True True False False 3 True True -6dB True True radio9db False False 4 True True -3dB True True radio9db False False 5 1 True VU True 2 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Phase True False False 3 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Spectrum True False False 4 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/invada_logo.png0000664000175000017500000000442311251515772024114 0ustar alessioalessioPNG  IHDR@@% sRGBbKGD pHYs  tIME 6ڄt0tEXtCommentCreated with GIMPWnIDAThY{hTsw&1j4c6Xj[m%,.YJVT0hPD"D TYS6v[ĴcL2$7q?f2y!.=߹9w=RH!RH! ¹@r}pΕԻ2W*.eB"0)HFQ/jsr53 d/@7 @t *4^:i@A f3H zJrHMB&ȧ#,Yb07=0r1aFTNpS~ Z̔wt` n3c5+Εܵ;&ED'V+U| {Z1f#=].2LA>&=$4f0zh9[TQ;g &K~6TLᅼj1sOBG:Kۢ"0gpǸ߬dKEd/QP018 , dfʴa롵ue.%eړ39.3Gɠ(&a|#͞ɈK%LJ[Ɲs=_,t)KWϔXb6B%n2UFnnV=LGƁ|NNm"9dIӖϝ8|WhFRGJh5rG_,@FJ9Pa<=eiHǔͪ3g]AF~=!T"CZgG+^"fK[},#[Kc|m' .!zk[OI|2ŹFqgé zߟY\|enIUwOive<\}Kc.Sg"o$'~"@QqBD$"Dd~ 1ttz3ly󐏛%BmIT%ܹRq.^%ݗ(Ŝsιݿ?UWW)--R^p' j!c "0\rҥvŋP(ݝ>,+#"[Bv3Rʊ 4/]dO3gδ_+//'{&"PVVfY֩S1vh4kVTTQEE4MJ),))˗/R _;`0O6-Fի7n0M{֬YzQv=z㠹~.((BUUU޴'NҪB'OI>|_[jU(ڽ{7ܹ/P8׮]w^v?6l ˟UO][1((a1^>j38ΡRJ;?W})B )B kYdIENDB`invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_testtone_gui.xml0000664000175000017500000003667711251515772025253 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Test Tones</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 1 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 True Levels True False False 1 True 2 6 6 6 True 1 2 4 4 True 0.5 True 0 0 4 4 4 4 True Trim True 1 2 GTK_EXPAND True 0.5 True 0 0 4 4 4 4 True Frequency True GTK_EXPAND False False 2 True True True <span size="8000">Click to expose the test tones.</span> 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END True Test Tones False False 3 True True True <span size="8000">Click to expose the musical tones.</span> 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END True Musical Tones False False 4 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_delay_gui.xml0000664000175000017500000013532711251515772024474 0ustar alessioalessio 200 40 10 1 10 120 GTK_WINDOW_POPUP Invada Filter True True False False True <b>Delay</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True False False 1 True 2 6 6 6 True 0 True 2 1 2 True 4 True 0.5 True 0 0 4 4 4 4 True Mode True False True 0.5 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Munge True False 1 True 0.5 True True 0.5 GTK_SHADOW_NONE True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Period True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Width True 1 True LFO True False 2 4 4 True 4 True 0.5 True 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Delay True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Feedback True 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Pan True 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Volume True 3 True Delay 1 True False True 0.5 True 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Delay True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Feedback True 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Pan True 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Volume True 3 True Delay 2 True False 1 1 2 4 4 True Parameters True False False 2 True True True <span size="8000">Click to expose the delay calculator.</span> 2 True True True Tempo: False False 4 True True 6 adjustment1 2 False False 2 1 False False 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END False False 1 True Delay Calculator False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_delay_gui.glade0000664000175000017500000014265211251515772024747 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Delay</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True label_item False False 1 True 2 6 6 6 True 0 True 2 1 2 True 4 True 0.5 True 0 0 4 4 4 4 True Mode True label_item False True 0.5 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Munge True label_item False 1 True 0.5 True True 0.5 GTK_SHADOW_NONE True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Period True label_item True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Width True label_item 1 True LFO True label_item False 2 4 4 True 4 True 0.5 True 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Delay True label_item True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Feedback True label_item 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Pan True label_item 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Volume True label_item 3 True Delay 1 True label_item False True 0.5 True 0 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Delay True label_item True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Feedback True label_item 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Pan True label_item 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Volume True label_item 3 True Delay 2 True label_item False 1 1 2 4 4 True Parameters True label_item False False 2 True True True <span size="8000">Click to expose the delay calculator.</span> 2 True True True Tempo: False False 4 True True 6 120 40 200 1 10 10 2 False False 2 1 False False 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END label_item False False 1 True Delay Calculator label_item False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_compressor_gui.glade0000664000175000017500000007707411251515772026052 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Invada Compressor</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 3 True Audio In GTK_JUSTIFY_RIGHT 4 True Gain Reduction GTK_JUSTIFY_RIGHT 4 1 2 True Audio Out GTK_JUSTIFY_RIGHT 5 2 3 True 0 0 1 2 True 0 0 1 2 1 2 True 0 0 2 3 1 2 True Levels True label_item False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Compressor Response label_item 2 True 2 6 6 6 True 1 4 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True label_item 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Threshold True label_item 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Ratio True label_item 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Makeup Gain True label_item 2 2 True Compressor True label_item 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Attack True label_item 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Release True label_item 2 1 True Envelope True GTK_JUSTIFY_RIGHT label_item 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 22 4 4 4 True Detector True label_item GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_testtone_gui.glade0000664000175000017500000004047611251515772025517 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Test Tones</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 1 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 True Levels True label_item False False 1 True 2 6 6 6 True 1 2 4 4 True 0.5 True 0 0 4 4 4 4 True Trim True label_item 1 2 GTK_EXPAND True 0.5 True 0 0 4 4 4 4 True Frequency True label_item GTK_EXPAND False False 2 True True True <span size="8000">Click to expose the test tones.</span> 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END label_item True Test Tones label_item False False 3 True True True <span size="8000">Click to expose the musical tones.</span> 2 True 0 0 0 4 10 10 True 0 0.89999997615814209 GTK_SHADOW_IN True True False False GTK_TREE_VIEW_GRID_LINES_BOTH True True PANGO_ELLIPSIZE_END label_item True Musical Tones label_item False False 4 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_filter_gui.glade0000664000175000017500000004331011251515772025125 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Filter</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 2 True 0 0 1 2 1 2 True 0 0 1 2 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True Levels True label_item False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Frequency Response label_item 2 True 2 6 6 6 True 1 3 2 True 0.5 True 0 0 4 4 4 4 True Frequency True label_item GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Soft Clip True label_item 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Gain True label_item 1 2 GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_erreverb_gui.glade0000664000175000017500000006457311251515772025472 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Invada ER Reverb</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 8 4 4 True 2 2 True Audio In GTK_JUSTIFY_RIGHT 4 True Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True label_item False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Reverb Response label_item 2 True 2 6 6 6 True 1 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True HPF True label_item True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Warmth True label_item 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Diffusion True label_item 2 2 True Reverb True label_item 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 8 4 4 4 True True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Length True label_item 2 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Width True label_item 2 1 True 0.5 GTK_SHADOW_NONE True 0 0 4 4 4 4 True Height True label_item 2 2 True Room Size True GTK_JUSTIFY_RIGHT label_item GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_tube_gui.glade0000664000175000017500000004354111251515772024605 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Tube</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True label_item False False 1 True 2 6 6 6 True 1 4 2 True 0.5 True 0 0 4 4 4 4 True Tube Ø True label_item 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True DC Offset True label_item 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Blend True label_item 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Drive True label_item GTK_EXPAND GTK_FILL 2 2 False False 2 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_input_gui.xml0000664000175000017500000005450411251515772024532 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Input Module</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True False False 1 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Phase True False False 2 True 2 6 6 6 True 1 5 2 True 0.5 True 0 0 True True 0 0 4 8 4 4 True 0 0 8 4 4 4 1 True Soft Clip True 4 5 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Gain True 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Pan True 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 8 4 4 True 0 0 8 4 4 4 1 True Phase True GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Width True 3 4 GTK_EXPAND GTK_FILL 2 2 False False 3 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_tube_gui.xml0000664000175000017500000004222211251515772024324 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Tube</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 4 4 4 4 True 2 2 True 0.20000000298023224 Audio In GTK_JUSTIFY_RIGHT 4 True 0.20000000298023224 Audio Out GTK_JUSTIFY_RIGHT 5 1 2 True 0 0 1 2 True 0 0 1 2 1 2 True Levels True False False 1 True 2 6 6 6 True 1 4 2 True 0.5 True 0 0 4 4 4 4 True Tube Ø True 2 3 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True DC Offset True 1 2 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 4 4 4 4 True Blend True 3 4 GTK_EXPAND GTK_FILL 2 2 True 0.5 True 0 0 True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True Drive True GTK_EXPAND GTK_FILL 2 2 False False 2 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/inv_meter_gui.glade0000664000175000017500000004375211251515772024766 0ustar alessioalessio GTK_WINDOW_POPUP Invada Filter True True False False True <b>Meters</b> True GTK_JUSTIFY_CENTER 1 True 0 0 1 1 1 1 False False 2 False False True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Peak True label_item False False 1 True 2 6 6 6 True 0 True True True 0 0 4 4 4 4 True 0 0 4 4 4 4 1 True 0 0 4 4 True 9 True VU 0dB: False False True True -15dB 0 True True radio9db False False 1 True True -12dB 0 True True radio9db False False 2 True True -9dB 0 True True False False 3 True True -6dB 0 True True radio9db False False 4 True True -3dB 0 True True radio9db False False 5 1 True VU True label_item 2 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Phase True label_item False False 3 True 2 6 6 6 True 0 True 0 0 4 4 4 4 True Spectrum True label_item False False 4 invada-studio-plugins-lv2-1.2.0/plugingui/gtk/Makefile0000664000175000017500000000301411251515772022557 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # GLADES = inv_compressor_gui.xml \ inv_delay_gui.xml \ inv_erreverb_gui.xml \ inv_filter_gui.xml \ inv_input_gui.xml \ inv_meter_gui.xml \ inv_phaser_gui.xml \ inv_testtone_gui.xml \ inv_tube_gui.xml \ all: $(GLADES) # RULES TO BUILD XML inv_compressor_gui.xml: inv_compressor_gui.glade inv_delay_gui.xml: inv_delay_gui.glade inv_erreverb_gui.xml: inv_erreverb_gui.glade inv_filter_gui.xml: inv_filter_gui.glade inv_input_gui.xml: inv_input_gui.glade inv_meter_gui.xml: inv_meter_gui.glade inv_phaser_gui.xml: inv_phaser_gui.glade inv_testtone_gui.xml: inv_testtone_gui.glade inv_tube_gui.xml: inv_tube_gui.glade # OTHER TARGETS targets: $(GLADES) always: clean: -rm -f *.xml -rm -f *~ %.xml: %.glade @echo "Generating $@" @gtk-builder-convert $< $@ invada-studio-plugins-lv2-1.2.0/plugingui/inv_filter_gui.h0000664000175000017500000000232711251515772023516 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_filter_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_filter_display_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_filter_freq_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_filter_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_filter_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_erreverb_gui.h0000664000175000017500000000300411251515772024036 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_erreverb_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_length_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_height_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_hpf_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_warmth_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_diffusion_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_erreverb_display_motion(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_delay_gui.c0000664000175000017500000013106711251515772023326 0ustar alessioalessio/* This LV2 extension provides delay gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_delay.h" #include "inv_delay_gui.h" static LV2UI_Descriptor *IDelayGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *toggleMode; GtkWidget *toggleMungeMode; GtkWidget *knobCycle; GtkWidget *knobWidth; GtkWidget *lampLFO; GtkWidget *knobMunge; GtkWidget *knobDelay1; GtkWidget *knobFB1; GtkWidget *knobPan1; GtkWidget *knobVol1; GtkWidget *knobDelay2; GtkWidget *knobFB2; GtkWidget *knobPan2; GtkWidget *knobVol2; GtkWidget *spinTempo; GtkWidget *treeviewDelayCalc; gint InChannels; gint OutChannels; float bypass; float mode; float mungemode; float munge; float cycle; float width; float delay1; float fb1; float pan1; float vol1; float delay2; float fb2; float pan2; float vol2; float tempo; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IDelayGui; static LV2UI_Handle instantiateIDelayGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IDelayGui *pluginGui = (IDelayGui *)malloc(sizeof(IDelayGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_delay_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "delay_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "delay_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); pluginGui->spinTempo = GTK_WIDGET (gtk_builder_get_object (builder, "spinbutton_tempo")); pluginGui->treeviewDelayCalc = GTK_WIDGET (gtk_builder_get_object (builder, "treeview_delaycalc")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_mode_toggle")); pluginGui->toggleMode = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleMode); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_mungemode_toggle")); pluginGui->toggleMungeMode = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleMungeMode); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_munge_knob")); pluginGui->knobMunge = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobMunge); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_cycle_knob")); pluginGui->knobCycle = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobCycle); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_width_knob")); pluginGui->knobWidth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobWidth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_cycle_lamp")); pluginGui->lampLFO = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampLFO); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_delay1_knob")); pluginGui->knobDelay1 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDelay1); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_fb1_knob")); pluginGui->knobFB1 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobFB1); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_pan1_knob")); pluginGui->knobPan1 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobPan1); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_vol1_knob")); pluginGui->knobVol1 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobVol1); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_delay2_knob")); pluginGui->knobDelay2 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDelay2); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_fb2_knob")); pluginGui->knobFB2 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobFB2); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_pan2_knob")); pluginGui->knobPan2 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobPan2); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_vol2_knob")); pluginGui->knobVol2 = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobVol2); /* customise for the plugin */ if(!strcmp(plugin_uri,IDELAY_MONO_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Delay Munge (mono in)"); } if(!strcmp(plugin_uri,IDELAY_SUM_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Delay Munge (sum L+R in)"); } pluginGui->InChannels = 1; pluginGui->OutChannels = 2; pluginGui->bypass = 0.0; pluginGui->mode = 0.0; pluginGui->mungemode = 0.0; pluginGui->munge = 50.0; pluginGui->cycle = 20.0; pluginGui->width = 0.0; pluginGui->delay1 = 300.0; pluginGui->fb1 = 50.0; pluginGui->pan1 = -0.7; pluginGui->vol1 = 100.0; pluginGui->delay2 = 200.0; pluginGui->fb2 = 50.0; pluginGui->pan2 = 0.7; pluginGui->vol2 = 100.0; pluginGui->tempo = 120.0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_delay_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour (INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_OFF, "Discrete"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_ON, "Ping-Pong"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleMode), "Description: This switch changes the mode of the delay between discrete channels and ping-ping.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleMode),"button-release-event",G_CALLBACK(on_inv_delay_mode_toggle_button_release),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour (INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_OFF, "Type 1"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_ON, "Type 2"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), "Description: This switch changes the munge type used on the signal in the feedback loop.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleMungeMode),"button-release-event",G_CALLBACK(on_inv_delay_mungemode_toggle_button_release),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobMunge), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobMunge), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve( INV_KNOB (pluginGui->knobMunge), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobMunge), INV_KNOB_MARKINGS_5); inv_knob_set_units( INV_KNOB (pluginGui->knobMunge), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobMunge), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobMunge), 100.0); inv_knob_set_value( INV_KNOB (pluginGui->knobMunge), pluginGui->munge); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobMunge), "Description: This knob sets the amount of munge.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobMunge),"motion-notify-event",G_CALLBACK(on_inv_delay_munge_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobCycle), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve( INV_KNOB (pluginGui->knobCycle), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobCycle), INV_KNOB_MARKINGS_3); inv_knob_set_human( INV_KNOB (pluginGui->knobCycle)); inv_knob_set_units( INV_KNOB (pluginGui->knobCycle), "s"); inv_knob_set_min( INV_KNOB (pluginGui->knobCycle), 2.0); inv_knob_set_max( INV_KNOB (pluginGui->knobCycle), 200.0); inv_knob_set_value( INV_KNOB (pluginGui->knobCycle), pluginGui->cycle); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobCycle), "Description: This knob sets the period of the LFO.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobCycle), "motion-notify-event",G_CALLBACK(on_inv_delay_cycle_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobWidth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve( INV_KNOB (pluginGui->knobWidth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobWidth), INV_KNOB_MARKINGS_5); inv_knob_set_units( INV_KNOB (pluginGui->knobWidth), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobWidth), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobWidth), 100.0); inv_knob_set_value( INV_KNOB (pluginGui->knobWidth), pluginGui->width); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobWidth), "Description: This knob sets the width of the LFO.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobWidth),"motion-notify-event",G_CALLBACK(on_inv_delay_width_knob_motion),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampLFO),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampLFO),1.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampLFO), "This shows the LFO cycle."); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay1), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobDelay1), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobDelay1), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobDelay1), INV_KNOB_MARKINGS_3); inv_knob_set_human( INV_KNOB (pluginGui->knobDelay1)); inv_knob_set_units( INV_KNOB (pluginGui->knobDelay1), "s"); inv_knob_set_min( INV_KNOB (pluginGui->knobDelay1), 0.02); inv_knob_set_max( INV_KNOB (pluginGui->knobDelay1), 2.0); inv_knob_set_value( INV_KNOB (pluginGui->knobDelay1), pluginGui->delay1); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobDelay1), "Description: This knob sets the delay time for the first delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDelay1),"motion-notify-event",G_CALLBACK(on_inv_delay_delay1_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB1), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobFB1), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobFB1), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobFB1), INV_KNOB_MARKINGS_5); inv_knob_set_units( INV_KNOB (pluginGui->knobFB1), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobFB1), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobFB1), 133.3333); inv_knob_set_value( INV_KNOB (pluginGui->knobFB1), pluginGui->fb1); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobFB1), "Description: This knob sets the amount of feedback for the first delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobFB1),"motion-notify-event",G_CALLBACK(on_inv_delay_fb1_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan1), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobPan1), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobPan1), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobPan1), INV_KNOB_MARKINGS_PAN); inv_knob_set_min( INV_KNOB (pluginGui->knobPan1), -1.0); inv_knob_set_max( INV_KNOB (pluginGui->knobPan1), 1.0); inv_knob_set_value( INV_KNOB (pluginGui->knobPan1), pluginGui->pan1); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobPan1), "Description: This knob sets the position within the output mix for the first delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobPan1),"motion-notify-event",G_CALLBACK(on_inv_delay_pan1_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol1), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobVol1), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobVol1), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobVol1), INV_KNOB_MARKINGS_4); inv_knob_set_units( INV_KNOB (pluginGui->knobVol1), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobVol1), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobVol1), 100.0); inv_knob_set_value( INV_KNOB (pluginGui->knobVol1), pluginGui->vol1); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobVol1), "Description: This knob sets the volume in the output mix for the first delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobVol1),"motion-notify-event",G_CALLBACK(on_inv_delay_vol1_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay2), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobDelay2), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobDelay2), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobDelay2), INV_KNOB_MARKINGS_3); inv_knob_set_human( INV_KNOB (pluginGui->knobDelay2)); inv_knob_set_units( INV_KNOB (pluginGui->knobDelay2), "s"); inv_knob_set_min( INV_KNOB (pluginGui->knobDelay2), 0.02); inv_knob_set_max( INV_KNOB (pluginGui->knobDelay2), 2.0); inv_knob_set_value( INV_KNOB (pluginGui->knobDelay2), pluginGui->delay2); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobDelay2), "Description: This knob sets the delay time for the second delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDelay2),"motion-notify-event",G_CALLBACK(on_inv_delay_delay2_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB2), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobFB2), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobFB2), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobFB2), INV_KNOB_MARKINGS_5); inv_knob_set_units( INV_KNOB (pluginGui->knobFB2), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobFB2), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobFB2), 133.3333); inv_knob_set_value( INV_KNOB (pluginGui->knobFB2), pluginGui->fb2); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobFB2), "Description: This knob sets the amount of feedback for the second delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobFB2),"motion-notify-event",G_CALLBACK(on_inv_delay_fb2_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan2), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobPan2), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobPan2), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobPan2), INV_KNOB_MARKINGS_PAN); inv_knob_set_min( INV_KNOB (pluginGui->knobPan2), -1.0); inv_knob_set_max( INV_KNOB (pluginGui->knobPan2), 1.0); inv_knob_set_value( INV_KNOB (pluginGui->knobPan2), pluginGui->pan2); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobPan2), "Description: This knob sets the position within the output mix for the second delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobPan2),"motion-notify-event",G_CALLBACK(on_inv_delay_pan2_knob_motion),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol2), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobVol2), INV_KNOB_SIZE_SMALL); inv_knob_set_curve( INV_KNOB (pluginGui->knobVol2), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobVol2), INV_KNOB_MARKINGS_4); inv_knob_set_units( INV_KNOB (pluginGui->knobVol2), "%"); inv_knob_set_min( INV_KNOB (pluginGui->knobVol2), 0.0); inv_knob_set_max( INV_KNOB (pluginGui->knobVol2), 100.0); inv_knob_set_value( INV_KNOB (pluginGui->knobVol2), pluginGui->vol2); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobVol2), "Description: This knob sets the volume in the output mix for the second delay.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobVol2),"motion-notify-event",G_CALLBACK(on_inv_delay_vol2_knob_motion),pluginGui); gtk_spin_button_set_value(GTK_SPIN_BUTTON (pluginGui->spinTempo),pluginGui->tempo); g_signal_connect_after(G_OBJECT(pluginGui->spinTempo),"value-changed",G_CALLBACK(on_inv_delay_tempo_value_changed),pluginGui); inv_delay_init_delaycalc(pluginGui->treeviewDelayCalc); inv_delay_update_delaycalc(pluginGui->treeviewDelayCalc, pluginGui->tempo); g_signal_connect_after(G_OBJECT(pluginGui->treeviewDelayCalc),"button-release-event",G_CALLBACK(on_inv_delay_calc_button_release),pluginGui); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIDelayGui(LV2UI_Handle ui) { return; } static void port_eventIDelayGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IDelayGui *pluginGui = (IDelayGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IDELAY_BYPASS: pluginGui->bypass=value; if(value <= 0.5) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobMunge), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay1), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB1), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan1), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol1), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay2), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB2), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan2), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol2), INV_PLUGIN_ACTIVE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeviewDelayCalc),TRUE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobMunge), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay1), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB1), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan1), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol1), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDelay2), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFB2), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan2), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobVol2), INV_PLUGIN_BYPASS); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeviewDelayCalc),FALSE); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IDELAY_MODE: pluginGui->mode=value; if(value <= 0.5) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleMode), INV_SWITCH_TOGGLE_ON); } break; case IDELAY_MUNGEMODE: pluginGui->mungemode=value; if(value <= 0.5) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleMungeMode), INV_SWITCH_TOGGLE_ON); } break; case IDELAY_MUNGE: pluginGui->munge=value; inv_knob_set_value(INV_KNOB (pluginGui->knobMunge), pluginGui->munge); break; case IDELAY_LFO_CYCLE: pluginGui->cycle=value; inv_knob_set_value(INV_KNOB (pluginGui->knobCycle), pluginGui->cycle); break; case IDELAY_LFO_WIDTH: pluginGui->width=value; inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); break; case IDELAY_LAMP_LFO: inv_lamp_set_value(INV_LAMP (pluginGui->lampLFO),value); break; case IDELAY_1_DELAY: pluginGui->delay1=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDelay1), pluginGui->delay1); break; case IDELAY_1_FB: pluginGui->fb1=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFB1), pluginGui->fb1); break; case IDELAY_1_PAN: pluginGui->pan1=value; inv_knob_set_value(INV_KNOB (pluginGui->knobPan1), pluginGui->pan1); break; case IDELAY_1_VOL: pluginGui->vol1=value; inv_knob_set_value(INV_KNOB (pluginGui->knobVol1), pluginGui->vol1); break; case IDELAY_2_DELAY: pluginGui->delay2=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDelay2), pluginGui->delay2); break; case IDELAY_2_FB: pluginGui->fb2=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFB2), pluginGui->fb2); break; case IDELAY_2_PAN: pluginGui->pan2=value; inv_knob_set_value(INV_KNOB (pluginGui->knobPan2), pluginGui->pan2); break; case IDELAY_2_VOL: pluginGui->vol2=value; inv_knob_set_value(INV_KNOB (pluginGui->knobVol2), pluginGui->vol2); break; case IDELAY_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case IDELAY_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case IDELAY_METER_OUTR: inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; } } } static void init() { IDelayGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IDelayGuiDescriptor->URI = IDELAY_GUI_URI; IDelayGuiDescriptor->instantiate = instantiateIDelayGui; IDelayGuiDescriptor->cleanup = cleanupIDelayGui; IDelayGuiDescriptor->port_event = port_eventIDelayGui; IDelayGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IDelayGuiDescriptor) init(); switch (index) { case 0: return IDelayGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static gint inv_delay_get_col_number_from_tree_view_column (GtkTreeViewColumn *col) { GList *cols; gint num; g_return_val_if_fail ( col != NULL, -1 ); g_return_val_if_fail ( col->tree_view != NULL, -1 ); cols = gtk_tree_view_get_columns(GTK_TREE_VIEW(col->tree_view)); num = g_list_index(cols, (gpointer) col); g_list_free(cols); return num; } static void inv_delay_cell_data_function ( GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gint pos) { gfloat value; gchar buf[20]; gtk_tree_model_get(model, iter, pos, &value, -1); if(value >= 1.0) { g_snprintf(buf, sizeof(buf), "%.2fs ", floor(value*100)/100); } else if(value >= 0.1) { g_snprintf(buf, sizeof(buf), "%.0fms", floor(value*1000)); } else if(value >= 0.01) { g_snprintf(buf, sizeof(buf), "%.1fms", floor(value*10000)/10); } else if(value >= 0.001) { g_snprintf(buf, sizeof(buf), "%.2fms", floor(value*100000)/100); } else { g_snprintf(buf, sizeof(buf), "%.3fms", floor(value*1000000)/1000); } g_object_set(renderer, "text", buf, NULL); } static void inv_delay_length_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_LENGTH); } static void inv_delay_dotted_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_DOTTED); } static void inv_delay_tuplet32_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_TUPLET32); } static void inv_delay_tuplet54_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_TUPLET54); } static void inv_delay_tuplet74_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_TUPLET74); } static void inv_delay_tuplet94_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_TUPLET94); } static void inv_delay_tuplet114_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_delay_cell_data_function (col,renderer,model,iter,COLUMN_TUPLET114); } static void inv_delay_init_delaycalc(GtkWidget *tree) { GtkTreeViewColumn *col; GtkCellRenderer *renderer; // define columns /* NOTE */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Note"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",0.5,NULL); g_object_set (renderer,"weight",800,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_add_attribute(col, renderer, "text", COLUMN_NOTE); /* LENGTH */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " Length"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_length_cell_data_function, NULL, NULL); /* DOTTED */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " Dotted"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_dotted_cell_data_function, NULL, NULL); /* 3:2 Tuplet */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " 3:2 Tuplet"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_tuplet32_cell_data_function, NULL, NULL); /* 5:4 Tuplet */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " 5:4 Tuplet"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_tuplet54_cell_data_function, NULL, NULL); /* 7:4 Tuplet */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " 7:4 Tuplet"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_tuplet74_cell_data_function, NULL, NULL); /* 9:4 Tuplet */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " 9:4 Tuplet"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_tuplet94_cell_data_function, NULL, NULL); /* 11:4 Tuplet */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, " 11:4 Tuplet"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_delay_tuplet114_cell_data_function, NULL, NULL); /* tooltips */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "tooltips"); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); gtk_tree_view_column_set_visible (col,FALSE); gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(tree),COLUMN_TOOLTIP); return; } static void inv_delay_update_delaycalc(GtkWidget *tree, float tempo) { GtkListStore *liststore; GtkTreeIter iter; gfloat length; gint i; char notelabel[8]; length=240.0/tempo; //assumes beat length in time signature is a crotchet // create empty store liststore = gtk_list_store_new( NUM_COLS, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_STRING); for(i=0;i<7;i++) { gtk_list_store_append(liststore, &iter); if(i==0) { sprintf(notelabel,"1"); } else { sprintf(notelabel,"1/%i",(int)pow(2,i)); } gtk_list_store_set (liststore, &iter, COLUMN_NOTE, notelabel, COLUMN_LENGTH, length, COLUMN_DOTTED, length*1.5, COLUMN_TUPLET32, length*2/3, COLUMN_TUPLET54, length*4/5, COLUMN_TUPLET74, length*4/7, COLUMN_TUPLET94, length*4/9, COLUMN_TUPLET114, length*4/11, COLUMN_TOOLTIP, "Description: Calculated delay times for the current tempo across different length notes.\nUsage: Left-Click on a cell to assign the value to Delay 1, Right-Click to assign the value to Delay 2.", -1); length=length/2; } // add the model to the treeview gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(liststore)); return; } /*****************************************************************************/ static void on_inv_delay_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_delay_mode_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->mode=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_MODE, 4, 0, &pluginGui->mode); return; } static void on_inv_delay_mungemode_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->mungemode=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_MUNGEMODE, 4, 0, &pluginGui->mungemode); return; } static void on_inv_delay_munge_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->munge=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_MUNGE, 4, 0, &pluginGui->munge); return; } static void on_inv_delay_cycle_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->cycle=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_LFO_CYCLE, 4, 0, &pluginGui->cycle); return; } static void on_inv_delay_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->width=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_LFO_WIDTH, 4, 0, &pluginGui->width); return; } static void on_inv_delay_delay1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->delay1=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_1_DELAY, 4, 0, &pluginGui->delay1); return; } static void on_inv_delay_fb1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->fb1=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_1_FB, 4, 0, &pluginGui->fb1); return; } static void on_inv_delay_pan1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->pan1=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_1_PAN, 4, 0, &pluginGui->pan1); return; } static void on_inv_delay_vol1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->vol1=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_1_VOL, 4, 0, &pluginGui->vol1); return; } static void on_inv_delay_delay2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->delay2=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_2_DELAY, 4, 0, &pluginGui->delay2); return; } static void on_inv_delay_fb2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->fb2=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_2_FB, 4, 0, &pluginGui->fb2); return; } static void on_inv_delay_pan2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->pan2=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_2_PAN, 4, 0, &pluginGui->pan2); return; } static void on_inv_delay_vol2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->vol2=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IDELAY_2_VOL, 4, 0, &pluginGui->vol2); return; } static void on_inv_delay_tempo_value_changed(GtkWidget *widget, gpointer data) { IDelayGui *pluginGui = (IDelayGui *) data; pluginGui->tempo=gtk_spin_button_get_value(GTK_SPIN_BUTTON (pluginGui->spinTempo)); inv_delay_update_delaycalc(pluginGui->treeviewDelayCalc, pluginGui->tempo); return; } static void on_inv_delay_calc_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { GtkTreePath *path; GtkTreeViewColumn *column; GtkTreeModel *model; GtkTreeIter iter; gfloat value; gint col; IDelayGui *pluginGui = (IDelayGui *) data; model = gtk_tree_view_get_model(GTK_TREE_VIEW (pluginGui->treeviewDelayCalc)); gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW (pluginGui->treeviewDelayCalc), (gint) ((GdkEventButton*)event)->x, (gint) ((GdkEventButton*)event)->y, &path, &column, NULL, NULL); col=inv_delay_get_col_number_from_tree_view_column(column); if (col > 0 && gtk_tree_model_get_iter(model, &iter, path)) { gtk_tree_model_get(model, &iter, col, &value, -1); if(value >= 0.02 && value <= 2.0) { if(((GdkEventButton*)event)->button ==1) { pluginGui->delay1=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDelay1), pluginGui->delay1); (*pluginGui->write_function)(pluginGui->controller, IDELAY_1_DELAY, 4, 0, &pluginGui->delay1); } if(((GdkEventButton*)event)->button ==3) { pluginGui->delay2=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDelay2), pluginGui->delay2); (*pluginGui->write_function)(pluginGui->controller, IDELAY_2_DELAY, 4, 0, &pluginGui->delay2); } } } gtk_tree_path_free(path); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_input_gui.c0000664000175000017500000005371611251515772023373 0ustar alessioalessio/* This LV2 extension provides input module gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/meter-phase.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_input.h" #include "inv_input_gui.h" static LV2UI_Descriptor *IInputGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *meterPhase; GtkWidget *togglePhaseL; GtkWidget *togglePhaseR; GtkWidget *knobGain; GtkWidget *knobPan; GtkWidget *knobWidth; GtkWidget *toggleNoClip; GtkWidget *lampNoClip; gint InChannels; gint OutChannels; float bypass; float phaseL; float phaseR; float gain; float pan; float width; float noClip; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IInputGui; static LV2UI_Handle instantiateIInputGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IInputGui *pluginGui = (IInputGui *)malloc(sizeof(IInputGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_input_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "input_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "input_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_phase")); pluginGui->meterPhase = inv_phase_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterPhase); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_phaseL")); pluginGui->togglePhaseL = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->togglePhaseL); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_phaseR")); pluginGui->togglePhaseR = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->togglePhaseR); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_gain_knob")); pluginGui->knobGain = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobGain); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_pan_knob")); pluginGui->knobPan = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobPan); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_width_knob")); pluginGui->knobWidth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobWidth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_toggle")); pluginGui->toggleNoClip = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleNoClip); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_lamp")); pluginGui->lampNoClip = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampNoClip); pluginGui->InChannels = 2; pluginGui->OutChannels = 2; pluginGui->bypass = 0.0; pluginGui->phaseL = 0.0; pluginGui->phaseR = 0.0; pluginGui->gain = 0.0; pluginGui->pan = 0.0; pluginGui->width = 0.0; pluginGui->noClip = 0.0; inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_phase_meter_set_bypass(INV_PHASE_METER (pluginGui->meterPhase),INV_PLUGIN_ACTIVE); inv_phase_meter_set_phase(INV_PHASE_METER (pluginGui->meterPhase),0); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_input_bypass_toggle_button_release),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_label( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL),"LEFT"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_OFF, "Normal"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_ON, "Reversed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), "Description: This switch inverts the phase of the left channel.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->togglePhaseL),"button-release-event",G_CALLBACK(on_inv_input_phaseL_toggle_button_release),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_label( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR),"RIGHT"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_OFF, "Normal"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_ON, "Reversed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), "Description: This switch inverts the phase of the right channel.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->togglePhaseR),"button-release-event",G_CALLBACK(on_inv_input_phaseR_toggle_button_release),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobGain), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobGain), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobGain), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobGain), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobGain), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobGain), -24.0); inv_knob_set_max(INV_KNOB (pluginGui->knobGain), 24.0); inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobGain), "Description: This knob sets the input gain.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobGain),"motion-notify-event",G_CALLBACK(on_inv_input_gain_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobPan), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobPan), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobPan), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobPan), INV_KNOB_MARKINGS_PAN); inv_knob_set_highlight(INV_KNOB (pluginGui->knobPan), INV_KNOB_HIGHLIGHT_C); inv_knob_set_units(INV_KNOB (pluginGui->knobPan), ""); inv_knob_set_min(INV_KNOB (pluginGui->knobPan), -1.0); inv_knob_set_max(INV_KNOB (pluginGui->knobPan), 1.0); inv_knob_set_value(INV_KNOB (pluginGui->knobPan), pluginGui->pan); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobPan), "Description: This knob controls the balance between the left and right channels.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobPan),"motion-notify-event",G_CALLBACK(on_inv_input_pan_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobWidth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobWidth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobWidth), INV_KNOB_MARKINGS_CUST10); inv_knob_set_highlight(INV_KNOB (pluginGui->knobWidth), INV_KNOB_HIGHLIGHT_C); inv_knob_set_units(INV_KNOB (pluginGui->knobWidth), ""); inv_knob_set_custom(INV_KNOB (pluginGui->knobWidth), 0, "Mono"); inv_knob_set_custom(INV_KNOB (pluginGui->knobWidth), 1, "Normal"); inv_knob_set_custom(INV_KNOB (pluginGui->knobWidth), 2, "Stereo"); inv_knob_set_min(INV_KNOB (pluginGui->knobWidth), -1.0); inv_knob_set_max(INV_KNOB (pluginGui->knobWidth), 1.0); inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobWidth), "Description: This knob controls the relative mix of mono and stereo information within the signal.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobWidth),"motion-notify-event",G_CALLBACK(on_inv_input_width_knob_motion),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, "Off"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, "Active"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), "Description: This switch activates soft-clipping on the output. The soft clipping function outputs a value between -3dB and 0dB for input values between -3dB and +infinity.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleNoClip),"button-release-event",G_CALLBACK(on_inv_input_noClip_toggle_button_release),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampNoClip),3.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampNoClip), "This glows when soft clipping is occurring."); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIInputGui(LV2UI_Handle ui) { return; } static void port_eventIInputGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IInputGui *pluginGui = (IInputGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IINPUT_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_phase_meter_set_bypass( INV_PHASE_METER (pluginGui->meterPhase), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_phase_meter_set_bypass( INV_PHASE_METER (pluginGui->meterPhase), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobGain), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPan), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IINPUT_PHASEL: pluginGui->phaseL=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhaseL), INV_SWITCH_TOGGLE_ON); } break; case IINPUT_PHASER: pluginGui->phaseR=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhaseR), INV_SWITCH_TOGGLE_ON); } break; case IINPUT_GAIN: pluginGui->gain=value; inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); break; case IINPUT_PAN: pluginGui->pan=value; inv_knob_set_value(INV_KNOB (pluginGui->knobPan), pluginGui->pan); break; case IINPUT_WIDTH: pluginGui->width=value; inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); break; case IINPUT_NOCLIP: pluginGui->noClip=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON); } break; case IINPUT_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case IINPUT_METER_INR: inv_meter_set_RdB(INV_METER (pluginGui->meterIn),value); break; case IINPUT_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case IINPUT_METER_OUTR: inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; case IINPUT_METER_PHASE: inv_phase_meter_set_phase(INV_PHASE_METER (pluginGui->meterPhase),value); break; case IINPUT_METER_DRIVE: inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),value); break; } } } static void init() { IInputGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IInputGuiDescriptor->URI = IINPUT_GUI_URI; IInputGuiDescriptor->instantiate = instantiateIInputGui; IInputGuiDescriptor->cleanup = cleanupIInputGui; IInputGuiDescriptor->port_event = port_eventIInputGui; IInputGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IInputGuiDescriptor) init(); switch (index) { case 0: return IInputGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_input_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_input_phaseL_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->phaseL=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_PHASEL, 4, 0, &pluginGui->phaseL); return; } static void on_inv_input_phaseR_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->phaseR=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_PHASER, 4, 0, &pluginGui->phaseR); return; } static void on_inv_input_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->gain=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_GAIN, 4, 0, &pluginGui->gain); return; } static void on_inv_input_pan_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->pan=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_PAN, 4, 0, &pluginGui->pan); return; } static void on_inv_input_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->width=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_WIDTH, 4, 0, &pluginGui->width); return; } static void on_inv_input_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IInputGui *pluginGui = (IInputGui *) data; pluginGui->noClip=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IINPUT_NOCLIP, 4, 0, &pluginGui->noClip); return; } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/0000775000175000017500000000000011251515772022002 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/plugingui/widgets/knob-img_small.xpm0000664000175000017500000001415611251515772025432 0ustar alessioalessio/* XPM */ static char * knob_img_small_xpm[] = { "32 32 251 2", " c None", ". c #918880", "+ c #ACA49B", "@ c #A9A198", "# c #ABA29A", "$ c #A79E95", "% c #A29A91", "& c #A0988F", "* c #A59D95", "= c #A59C94", "- c #9F968E", "; c #9B9289", "> c #988F86", ", c #B6AEA6", "' c #A9A199", ") c #A49B93", "! c #A79F97", "~ c #A79E96", "{ c #9E958D", "] c #9D958D", "^ c #A0978F", "/ c #A39A92", "( c #A29991", "_ c #999088", ": c #A1988F", "< c #A49B92", "[ c #BCB4AC", "} c #ADA49C", "| c #A19991", "1 c #A19992", "2 c #A19890", "3 c #9E958E", "4 c #A69E96", "5 c #A29990", "6 c #ABA299", "7 c #A49C95", "8 c #A9A098", "9 c #A49C94", "0 c #A79F96", "a c #A09790", "b c #A49C93", "c c #A69E95", "d c #A89F97", "e c #A9A097", "f c #A69D95", "g c #A39A91", "h c #999188", "i c #C1B7AF", "j c #BAB1A9", "k c #B1A8A0", "l c #B1A9A0", "m c #AAA198", "n c #A49B94", "o c #ABA39A", "p c #B0A89F", "q c #A39A93", "r c #9D958C", "s c #9C938B", "t c #9A9188", "u c #BDB4AC", "v c #BCB3AA", "w c #B6ADA5", "x c #AEA59C", "y c #AFA69D", "z c #ADA49B", "A c #AEA59E", "B c #AAA199", "C c #A89F96", "D c #A59C93", "E c #9C948B", "F c #988F87", "G c #C7BEB5", "H c #BAB1A8", "I c #B1A89F", "J c #B5ACA4", "K c #B0A8A0", "L c #B4ABA3", "M c #AFA69E", "N c #B2A9A0", "O c #AAA19A", "P c #ACA39B", "Q c #AAA299", "R c #9F978E", "S c #A59C92", "T c #999087", "U c #9B928A", "V c #AAA095", "W c #B2A9A1", "X c #B0A79E", "Y c #B8B0A7", "Z c #B3AAA2", "` c #ADA59C", " . c #B6ACA4", ".. c #ACA39A", "+. c #BFB6AF", "@. c #BCB4AB", "#. c #B7AEA6", "$. c #A8A097", "%. c #AFA79F", "&. c #B1A9A1", "*. c #B5ABA3", "=. c #AEA59B", "-. c #9D948C", ";. c #9E958C", ">. c #90877F", ",. c #C0B7AE", "'. c #B4ACA3", "). c #ACA39C", "!. c #B0A7A0", "~. c #B8AFA8", "{. c #B3AAA1", "]. c #B7ADA4", "^. c #ADA39A", "/. c #B8AFA6", "(. c #A0978E", "_. c #9D948B", ":. c #B8AFA7", "<. c #B6ADA6", "[. c #B2AAA2", "}. c #B5ACA5", "|. c #BAB2AA", "1. c #B6ADA3", "2. c #BBB2A9", "3. c #B1A79E", "4. c #A39991", "5. c #989087", "6. c #B9B0A8", "7. c #B9B0A7", "8. c #C0B7AF", "9. c #BEB5AD", "0. c #B6ADA4", "a. c #B4ABA2", "b. c #B0A79F", "c. c #9F968D", "d. c #999086", "e. c #9B9288", "f. c #C3BAB1", "g. c #C5BCB4", "h. c #BCB3AB", "i. c #AEA59D", "j. c #B5ADA4", "k. c #A89E95", "l. c #A19990", "m. c #A59B93", "n. c #A69D94", "o. c #BEB5AC", "p. c #BBB2AA", "q. c #B7AEA5", "r. c #B2A9A2", "s. c #ACA399", "t. c #A39B93", "u. c #9F978D", "v. c #B5ACA3", "w. c #A39B92", "x. c #9A9088", "y. c #9C938A", "z. c #9B938A", "A. c #9E948B", "B. c #BFB6AE", "C. c #C3BAB2", "D. c #C2B9B1", "E. c #B6AEA5", "F. c #AFA79E", "G. c #AEA69D", "H. c #B4AAA2", "I. c #958C84", "J. c #B4ABA4", "K. c #B4ACA4", "L. c #ACA49C", "M. c #BFB6AD", "N. c #A49A92", "O. c #B0A69D", "P. c #B9AFA6", "Q. c #AFA59D", "R. c #ACA29A", "S. c #A29992", "T. c #BDB4AB", "U. c #C1B8B0", "V. c #B7AFA6", "W. c #BBB3AD", "X. c #A29EB8", "Y. c #B2A89F", "Z. c #C1B7AE", "`. c #AFA59C", " + c #978E86", ".+ c #C8BFB6", "++ c #9592B0", "@+ c #2134E5", "#+ c #0B23F9", "$+ c #9E9BBD", "%+ c #BBB1A8", "&+ c #A29890", "*+ c #A0978D", "=+ c #BAB0A8", "-+ c #B1ACB6", ";+ c #4550D2", ">+ c #011BFC", ",+ c #001AFF", "'+ c #626BD9", ")+ c #BDB3AA", "!+ c #9F958C", "~+ c #968D82", "{+ c #B9B2B3", "]+ c #6D72C4", "^+ c #0B22F3", "/+ c #1026F3", "(+ c #7E81C5", "_+ c #BFB7AF", ":+ c #C2B8AF", "<+ c #021BFA", "[+ c #011AFE", "}+ c #4451DC", "|+ c #B2ABB3", "1+ c #BCB2A9", "2+ c #B4AAA1", "3+ c #ACA299", "4+ c #B2A99F", "5+ c #2134EC", "6+ c #9797C3", "7+ c #C7BEB6", "8+ c #A39990", "9+ c #A59D94", "0+ c #1529E5", "a+ c #B9B1AF", "b+ c #C6BDB5", "c+ c #BFB5AD", "d+ c #B9B0A6", "e+ c #A39A90", "f+ c #A2998F", "g+ c #D0C8BF", "h+ c #CBC2BA", "i+ c #C8C0B8", "j+ c #C4BBB3", "k+ c #ABA198", "l+ c #AAA097", "m+ c #CCC4BC", "n+ c #C5BCB3", "o+ c #B5ABA2", "p+ c #B3A9A0", "q+ c #CBC2B9", "r+ c #CCC3BA", "s+ c #C1B9B0", "t+ c #B2AAA1", "u+ c #B8AEA6", "v+ c #BCB2AA", "w+ c #C4BAB0", "x+ c #BBB3AB", "y+ c #C0B7AD", "z+ c #BCB3A9", "A+ c #B9B0A9", "B+ c #BAB0A7", " . + @ # $ % & * = - ; > ", " , ' ) ! ~ { ] ^ ~ / ( / _ { : < ", " [ ' } | ^ 1 2 3 4 $ 5 < ( / 6 = ( = ( 1 ", " 7 8 9 0 + | a b = c ^ 5 d e < ( f ) { c g h ", " i j k l m 2 n 9 o $ | 8 p 8 % q ~ r 5 g s ) { t ", " u v w l x y z A $ ^ f A m ~ B # = ; C g D g E < 0 F ", " G H I J K L M N z g O P Q B d e R ~ e f e S g g T U s V ", " W X Y Z 6 M W ` W ...M ..# ) ' ..C z ..c 0 2 _ / < : ; ", " j +.@.#.$.# %.&.#.*.N 8 # B # l M =.X ..z $ s -.: D / ;.T >. ", " ,.'.W ).` !.~.L {.].y ^.x {./.H w x z z / ;.-.(.(.) h > _.;. ", "I :.<.[.}.k |.!.:.1.....x 2.v w x y 3.< 4.5 - 5 < D 5.: (.T F < ", "#.6.7.8.9.:.j 0.z 8 X 0.X a.P } b.C e / 2 D ~ 6 b - < c.{ d.(.e.", "f.u g.h.w #.Q B Z L L 6.a.i.j.i.) P P x k.~ C l...m.2 ^ { ;.n.C ", "8.o.h.p.a.@ W j W {.b...q.q.C C + N r.z s.m # z n.( f t.= e f u.", "/.o.0.M } h.6.b.v.k I H N 8 X :.#.'.y m ~ C ) D $ e B B g k._.(.", "v a.{.9.j }.v.I X q.} ..I } W v.v.:.N {.e 6 X {.P 6 w.$.x.y.z.A.", "B.C.D.@.Z J E.p.k M y F.w q.i.L N {.q.m G.H.^.m f C t.] I.(.;.-.", "D.o.j.J.a.K.k b.L.K.M.2.N k b.W q.H.v.0.3.{.N.= y & ^ & 5 < n.(.", "u H :.|.:.q.#.6.u B.q.w p L q.O.*.H P.Q.R.f Q e S.;.2 (.n.< 5 s ", "T.U.U.:.:.V.W.X.U.j 6.N 7.I Y.Z.T.H.`.`.G...= ) R % C ) n.-. +-.", ".+D.L i.[ ++@+#+$+v j #.L H i %+W X *.N C < &+c.~ 5 g g _ { *+: ", "=+&.w -+;+>+,+,+'+D./.7.f.2.v.v.)+H =.6 e k.m C $ e !+-.& s T ~+", " {+]+^+,+,+/+(+_+v.M.8.7.H 0.:+M.z m N N X C ..D - < _.U 2 < ", " <+,+,+[+}+|+0.8.g.B.u Z H 1+o.w 2+w *.3+N 4+) | c.; & % l.< ", " ,+5+6+8.M.7+8.M.M.p.T.I B Y.T./.X 6 v.6 ~ 2 5 8+9+g / .. ", " 0+a+U.7+b+g.G c+:+T.k b.0.].d+6 N x } B g e+f+m.( d d k. ", " g+h+i+7+j+9.U.6.q.a.P.w x # N y b.$ k+e+~ ~ m l+e (. ", " m+b+n+U.C.B.,.B.o.o+y x M b.e `.m z o X y `.i.p+ ", " q+r+s+p.B.B.h.t+0.I Z W y `.N I y {.z p+y 6 ", " 7.2.f.M.a.*.p.6.j v.q.I u+J :.z } 1.l+v+ ", " w+N x+y+T.p.:.q. .6.j v.M X {.x ", " z+h.7.=+7.A+u 7.p 7.J B+ "}; invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-Spectrograph.c0000664000175000017500000004037111251515772026257 0ustar alessioalessio/* This widget provides peak display_specs (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "string.h" #include "math.h" #include "widgets.h" #include "display-Spectrograph.h" static void inv_display_spec_class_init(InvDisplaySpecClass *klass); static void inv_display_spec_init(InvDisplaySpec *display_spec); static void inv_display_spec_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_display_spec_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_display_spec_realize(GtkWidget *widget); static gboolean inv_display_spec_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_display_spec_paint(GtkWidget *widget, gint drawmode, gint pos); static void inv_display_spec_destroy(GtkObject *object); static void inv_display_spec_draw_bar(GtkWidget *widget, cairo_t *cr, gint x, gint y, gint pos, gint lastpos, gint drawmode, gint bypass); static void inv_display_spec_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led); GtkType inv_display_spec_get_type(void) { static GType inv_display_spec_type = 0; char *name; int i; if (!inv_display_spec_type) { static const GTypeInfo type_info = { sizeof(InvDisplaySpecClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_display_spec_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvDisplaySpec), 0, /* n_preallocs */ (GInstanceInitFunc)inv_display_spec_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvDisplaySpec-%p-%d",inv_display_spec_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_display_spec_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_display_spec_type; } void inv_display_spec_set_bypass(InvDisplaySpec *display_spec, gint num) { gint i; if(display_spec->bypass != num) { display_spec->bypass = num; for(i=0;i<31;i++) { display_spec->value[i]=-90; } } } void inv_display_spec_set_value(InvDisplaySpec *display_spec, gint pos, float num) { if(pos >=0 && pos <= 30) { display_spec->value[pos]=num; if(GTK_WIDGET_REALIZED(display_spec)) { inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_ONE,pos); } } } void inv_display_spec_draw_now(InvDisplaySpec *display_spec, gint mode) { if(GTK_WIDGET_REALIZED(display_spec)) { switch(mode) { case INV_DISPLAY_SPEC_DRAW_ALL: inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_ALL,0); break; case INV_DISPLAY_SPEC_DRAW_DATA: inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_DATA,0); break; } } } GtkWidget * inv_display_spec_new() { return GTK_WIDGET(gtk_type_new(inv_display_spec_get_type())); } static void inv_display_spec_class_init(InvDisplaySpecClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_display_spec_realize; widget_class->size_request = inv_display_spec_size_request; widget_class->size_allocate = inv_display_spec_size_allocate; widget_class->expose_event = inv_display_spec_expose; object_class->destroy = inv_display_spec_destroy; } static void inv_display_spec_init(InvDisplaySpec *display_spec) { gint i; display_spec->bypass = INV_PLUGIN_ACTIVE; for(i=0;i<31;i++) { display_spec->value[i] = -90.0; display_spec->lastvalue[i] = 0; } strcpy(display_spec->label[0],"20"); strcpy(display_spec->label[1],"25"); strcpy(display_spec->label[2],"31"); strcpy(display_spec->label[3],"40"); strcpy(display_spec->label[4],"50"); strcpy(display_spec->label[5],"63"); strcpy(display_spec->label[6],"80"); strcpy(display_spec->label[7],"100"); strcpy(display_spec->label[8],"125"); strcpy(display_spec->label[9],"160"); strcpy(display_spec->label[10],"200"); strcpy(display_spec->label[11],"250"); strcpy(display_spec->label[12],"315"); strcpy(display_spec->label[13],"400"); strcpy(display_spec->label[14],"500"); strcpy(display_spec->label[15],"630"); strcpy(display_spec->label[16],"800"); strcpy(display_spec->label[17],"1k"); strcpy(display_spec->label[18],"1.2k"); strcpy(display_spec->label[19],"1.6k"); strcpy(display_spec->label[20],"2k"); strcpy(display_spec->label[21],"2.5k"); strcpy(display_spec->label[22],"3.1k"); strcpy(display_spec->label[23],"4k"); strcpy(display_spec->label[24],"5k"); strcpy(display_spec->label[25],"6.3k"); strcpy(display_spec->label[26],"8k"); strcpy(display_spec->label[27],"10k"); strcpy(display_spec->label[28],"12k"); strcpy(display_spec->label[29],"16k"); strcpy(display_spec->label[30],"20k"); display_spec->mOff60.R =0.1; display_spec->mOff60.G =0.1; display_spec->mOff60.B =0.4; display_spec->mOn60.R =-0.1; display_spec->mOn60.G =-0.1; display_spec->mOn60.B =0.6; display_spec->mOff12.R =0.2; display_spec->mOff12.G =0.3; display_spec->mOff12.B =0.4; display_spec->mOn12.R =-0.1; display_spec->mOn12.G =0.3; display_spec->mOn12.B =0.6; display_spec->mOff6.R =0.2; display_spec->mOff6.G =0.4; display_spec->mOff6.B =0.2; display_spec->mOn6.R =0.1; display_spec->mOn6.G =0.6; display_spec->mOn6.B =-0.1; display_spec->mOff0.R =0.5; display_spec->mOff0.G =0.5; display_spec->mOff0.B =0.0; display_spec->mOn0.R =0.5; display_spec->mOn0.G =0.5; display_spec->mOn0.B =0.0; display_spec->overOff.R=0.4; display_spec->overOff.G=0.2; display_spec->overOff.B=0.0; display_spec->overOn.R =0.6; display_spec->overOn.G =0.0; display_spec->overOn.B =0.0; display_spec->font_size=0; gtk_widget_set_tooltip_markup(GTK_WIDGET(display_spec),"Spectrograph"); } static void inv_display_spec_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_SPEC(widget)); g_return_if_fail(requisition != NULL); requisition->width = 377; requisition->height = 160; } static void inv_display_spec_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_SPEC(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_display_spec_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_SPEC(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 377; attributes.height = 160; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_display_spec_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_DISPLAY_SPEC(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_display_spec_paint(widget,INV_DISPLAY_SPEC_DRAW_ALL,0); return FALSE; } static void inv_display_spec_paint(GtkWidget *widget, gint drawmode, gint pos) { gint bypass; gint ledpos,i,fh; cairo_t *cr; GtkStyle *style; char label[10]; cairo_text_extents_t extents; style = gtk_widget_get_style(widget); bypass = INV_DISPLAY_SPEC(widget)->bypass; cr = gdk_cairo_create(widget->window); if(INV_DISPLAY_SPEC(widget)->font_size==0) { INV_DISPLAY_SPEC(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } switch(drawmode) { case INV_DISPLAY_SPEC_DRAW_ALL: gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]); cairo_paint(cr); cairo_set_source_rgb(cr, 0, 0, 0); cairo_rectangle(cr, 0, 0, 376, 139); cairo_fill(cr); cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 138); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 375, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 138); cairo_line_to(cr, 375, 138); cairo_line_to(cr, 375, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_DISPLAY_SPEC(widget)->font_size); strcpy(label,"0"); cairo_text_extents (cr,label,&extents); fh=extents.height; for(i=0;i<31;i++) { cairo_text_extents (cr,INV_DISPLAY_SPEC(widget)->label[i],&extents); switch (i) { case 0: case 2: case 4: case 6: case 8: case 10: case 12: case 14: case 16: case 18: case 20: case 22: case 24: case 26: case 28: case 30: if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_rectangle(cr, (i*12)+7,140, 1, 2); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } cairo_move_to(cr,(i*12)+7-(extents.width/2),144+fh); cairo_show_text(cr,INV_DISPLAY_SPEC(widget)->label[i]); break; case 1: case 3: case 5: case 7: case 9: case 11: case 13: case 15: case 17: case 19: case 21: case 23: case 25: case 27: case 29: if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_rectangle(cr, (i*12)+7,140, 1, 11); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } cairo_move_to(cr,(i*12)+7-(extents.width/2),153+fh); cairo_show_text(cr,INV_DISPLAY_SPEC(widget)->label[i]); break; } } for(i=0;i<31;i++) { ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[i]+60.51) : 0 ; inv_display_spec_draw_bar(widget, cr, (i*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[i], drawmode,bypass); INV_DISPLAY_SPEC(widget)->lastvalue[i]=ledpos; } break; case INV_DISPLAY_SPEC_DRAW_DATA: for(i=0;i<31;i++) { ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[i]+60.51) : 0 ; inv_display_spec_draw_bar(widget, cr, (i*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[i], drawmode,bypass); INV_DISPLAY_SPEC(widget)->lastvalue[i]=ledpos; } break; case INV_DISPLAY_SPEC_DRAW_ONE: ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[pos]+60.51) : 0 ; inv_display_spec_draw_bar(widget, cr, (pos*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[pos], drawmode,bypass); INV_DISPLAY_SPEC(widget)->lastvalue[pos]=ledpos; break; } cairo_destroy(cr); } static void inv_display_spec_destroy(GtkObject *object) { InvDisplaySpec *display_spec; InvDisplaySpecClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_DISPLAY_SPEC(object)); display_spec = INV_DISPLAY_SPEC(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static void inv_display_spec_draw_bar(GtkWidget *widget, cairo_t *cr, gint x, gint y, gint pos, gint lastpos, gint drawmode, gint bypass) { gint i,Lon,min,max; struct colour led; switch(drawmode) { case INV_DISPLAY_SPEC_DRAW_ALL: for ( i = 1; i <= 67; i++) { Lon = i <= pos ? 1 : 0; inv_display_spec_colour_tozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, x, y-(i*2), 10, 1); cairo_fill(cr); } break; case INV_DISPLAY_SPEC_DRAW_DATA: case INV_DISPLAY_SPEC_DRAW_ONE: min = lastpos < pos ? lastpos : pos; max = lastpos > pos ? lastpos : pos; if(min<1) min=1; if(max<1) max=1; if(min>67) min=67; if(max>67) max=67; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Lon = i <= pos ? 1 : 0; inv_display_spec_colour_tozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, x, y-(i*2), 10, 1); cairo_fill(cr); } } break; } } static void inv_display_spec_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led) { float r1,r2; struct colour mOff60 = INV_DISPLAY_SPEC(widget)->mOff60; struct colour mOn60 = INV_DISPLAY_SPEC(widget)->mOn60; struct colour mOff12 = INV_DISPLAY_SPEC(widget)->mOff12; struct colour mOn12 = INV_DISPLAY_SPEC(widget)->mOn12; struct colour mOff6 = INV_DISPLAY_SPEC(widget)->mOff6; struct colour mOn6 = INV_DISPLAY_SPEC(widget)->mOn6; struct colour mOff0 = INV_DISPLAY_SPEC(widget)->mOff0; struct colour mOn0 = INV_DISPLAY_SPEC(widget)->mOn0; struct colour overOff = INV_DISPLAY_SPEC(widget)->overOff; struct colour overOn = INV_DISPLAY_SPEC(widget)->overOn; /* 66 = +6dB 60 = 0dB 48 = -12dB 36 = -24dB */ if(pos < 36) { r1=(36.0-(float)pos)/36.0; r2=(float)pos/36.0; led->R=(r1 * mOff60.R + (r2 * mOff12.R)) + (on * ((r1 * mOn60.R) + (r2 * mOn12.R))) ; led->G=(r1 * mOff60.G + (r2 * mOff12.G)) + (on * ((r1 * mOn60.G) + (r2 * mOn12.G))) ; led->B=(r1 * mOff60.B + (r2 * mOff12.B)) + (on * ((r1 * mOn60.B) + (r2 * mOn12.B))) ; } else if (pos < 48) { r1=(48.0-(float)pos)/12.0; r2=((float)pos-36.0)/12.0; led->R=(r1 * mOff12.R + (r2 * mOff6.R)) + (on * ((r1 * mOn12.R) + (r2 * mOn6.R))) ; led->G=(r1 * mOff12.G + (r2 * mOff6.G)) + (on * ((r1 * mOn12.G) + (r2 * mOn6.G))) ; led->B=(r1 * mOff12.B + (r2 * mOff6.B)) + (on * ((r1 * mOn12.B) + (r2 * mOn6.B))) ; } else if (pos < 60) { r1=(60.0-(float)pos)/12.0; r2=((float)pos-48.0)/12.0; led->R=(r1 * mOff6.R + (r2 * mOff0.R)) + (on * ((r1 * mOn6.R) + (r2 * mOn0.R))) ; led->G=(r1 * mOff6.G + (r2 * mOff0.G)) + (on * ((r1 * mOn6.G) + (r2 * mOn0.G))) ; led->B=(r1 * mOff6.B + (r2 * mOff0.B)) + (on * ((r1 * mOn6.B) + (r2 * mOn0.B))) ; } else { led->R=overOff.R + (on * overOn.R) ; led->G=overOff.G + (on * overOn.G) ; led->B=overOff.B + (on * overOn.B) ; } if(bypass==INV_PLUGIN_BYPASS) { led->R=(led->R+led->G+led->B)/3; led->G=led->R; led->B=led->R; } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-FrequencyGain.h0000664000175000017500000000410611251515772026357 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DISPLAYFG_H #define __DISPLAYFG_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_DISPLAYFG_MODE_LPF 0 #define INV_DISPLAYFG_MODE_HPF 1 #define INV_DISPLAYFG_DRAW_ALL 0 #define INV_DISPLAYFG_DRAW_DATA 1 #define INV_DISPLAY_FG(obj) GTK_CHECK_CAST(obj, inv_display_fg_get_type (), InvDisplayFG) #define INV_DISPLAY_FG_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_display_fg_get_type(), InvDisplayFGClass) #define INV_IS_DISPLAY_FG(obj) GTK_CHECK_TYPE(obj, inv_display_fg_get_type()) typedef struct _InvDisplayFG InvDisplayFG; typedef struct _InvDisplayFGClass InvDisplayFGClass; struct _InvDisplayFG { GtkWidget widget; gint bypass; gint mode; float freq; float gain; float Lastfreq; float Lastgain; GtkStateType Laststate; gint font_size; }; struct _InvDisplayFGClass { GtkWidgetClass parent_class; }; GtkType inv_display_fg_get_type(void); GtkWidget * inv_display_fg_new(); void inv_display_fg_set_bypass(InvDisplayFG *displayFG, gint num); void inv_display_fg_set_mode(InvDisplayFG *displayFG, gint num); void inv_display_fg_set_freq(InvDisplayFG *displayFG, float num); void inv_display_fg_set_gain(InvDisplayFG *displayFG, float num); float inv_display_fg_get_freq(InvDisplayFG *displayFG); float inv_display_fg_get_gain(InvDisplayFG *displayFG); G_END_DECLS #endif /* __DISPLAYFG_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-vu.c0000664000175000017500000004447411251515772023727 0ustar alessioalessio/* This widget provides vu meters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "widgets.h" #include "meter-vu.h" static void inv_vu_meter_class_init(InvVuMeterClass *klass); static void inv_vu_meter_init(InvVuMeter *meter); static void inv_vu_meter_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_vu_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_vu_meter_realize(GtkWidget *widget); static gboolean inv_vu_meter_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_vu_meter_paint(GtkWidget *widget, gint mode); static void inv_vu_meter_destroy(GtkObject *object); GtkType inv_vu_meter_get_type(void) { static GType inv_vu_meter_type = 0; char *name; int i; if (!inv_vu_meter_type) { static const GTypeInfo type_info = { sizeof(InvVuMeterClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_vu_meter_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvVuMeter), 0, /* n_preallocs */ (GInstanceInitFunc)inv_vu_meter_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvVuMeter-%p-%d",inv_vu_meter_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_vu_meter_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_vu_meter_type; } void inv_vu_meter_set_bypass(InvVuMeter *meter, gint num) { if(meter->bypass != num) { meter->bypass = num; meter->value=0; } } void inv_vu_meter_set_value(InvVuMeter *meter, float num) { meter->value = num; if(GTK_WIDGET_REALIZED(meter) && meter->value != meter->lastvalue) inv_vu_meter_paint(GTK_WIDGET(meter),INV_VU_METER_DRAW_DATA); } GtkWidget * inv_vu_meter_new() { return GTK_WIDGET(gtk_type_new(inv_vu_meter_get_type())); } void inv_vu_meter_set_headroom(InvVuMeter *meter, gint num) { if(meter->headroom != num) { meter->headroom = num; meter->scale=pow(10,((float)meter->headroom+4.0)/20.0); } } static void inv_vu_meter_class_init(InvVuMeterClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_vu_meter_realize; widget_class->size_request = inv_vu_meter_size_request; widget_class->size_allocate = inv_vu_meter_size_allocate; widget_class->expose_event = inv_vu_meter_expose; object_class->destroy = inv_vu_meter_destroy; } static void inv_vu_meter_init(InvVuMeter *meter) { meter->bypass = INV_PLUGIN_ACTIVE; meter->value = 0; gtk_widget_set_tooltip_markup(GTK_WIDGET(meter),"VU Meter."); meter->headroom=9; meter->scale=pow(10,((float)meter->headroom+4)/20); meter->cx=91.0; meter->cy=130.0; meter->r[0]=101.0; //needle meter->r[1]=104.0; //markings lower meter->r[2]=112.0; //markings upper meter->r[3]=114.0; //labels meter->a[0]=(-INV_PI/2)-0.7943; //-inf db meter->a[1]=(-INV_PI/2)+(1-0.7943); //0db meter->a[2]=(-INV_PI/2)+0.7943; //max scale (approx +4db) meter->a[3]=(-INV_PI/2)-0.83; //- needle clip meter->a[4]=(-INV_PI/2)+0.83; //+ needle clip meter->dbm20[0].x=meter->cx+meter->r[1]*sin(0.1-0.7943); meter->dbm20[0].y=meter->cy-meter->r[1]*cos(0.1-0.7943); meter->dbm20[1].x=meter->cx+meter->r[2]*sin(0.1-0.7943); meter->dbm20[1].y=meter->cy-meter->r[2]*cos(0.1-0.7943); meter->dbm20[2].x=meter->cx+meter->r[3]*sin(0.1-0.7943); meter->dbm20[2].y=meter->cy-meter->r[3]*cos(0.1-0.7943); meter->dbm10[0].x=meter->cx+meter->r[1]*sin(0.3162277-0.7943); meter->dbm10[0].y=meter->cy-meter->r[1]*cos(0.3162277-0.7943); meter->dbm10[1].x=meter->cx+meter->r[2]*sin(0.3162277-0.7943); meter->dbm10[1].y=meter->cy-meter->r[2]*cos(0.3162277-0.7943); meter->dbm10[2].x=meter->cx+meter->r[3]*sin(0.3162277-0.7943); meter->dbm10[2].y=meter->cy-meter->r[3]*cos(0.3162277-0.7943); meter->dbm07[0].x=meter->cx+meter->r[1]*sin(0.4466835-0.7943); meter->dbm07[0].y=meter->cy-meter->r[1]*cos(0.4466835-0.7943); meter->dbm07[1].x=meter->cx+meter->r[2]*sin(0.4466835-0.7943); meter->dbm07[1].y=meter->cy-meter->r[2]*cos(0.4466835-0.7943); meter->dbm07[2].x=meter->cx+meter->r[3]*sin(0.4466835-0.7943); meter->dbm07[2].y=meter->cy-meter->r[3]*cos(0.4466835-0.7943); meter->dbm05[0].x=meter->cx+meter->r[1]*sin(0.5623413-0.7943); meter->dbm05[0].y=meter->cy-meter->r[1]*cos(0.5623413-0.7943); meter->dbm05[1].x=meter->cx+meter->r[2]*sin(0.5623413-0.7943); meter->dbm05[1].y=meter->cy-meter->r[2]*cos(0.5623413-0.7943); meter->dbm05[2].x=meter->cx+meter->r[3]*sin(0.5623413-0.7943); meter->dbm05[2].y=meter->cy-meter->r[3]*cos(0.5623413-0.7943); meter->dbm03[0].x=meter->cx+meter->r[1]*sin(0.7079457-0.7943); meter->dbm03[0].y=meter->cy-meter->r[1]*cos(0.7079457-0.7943); meter->dbm03[1].x=meter->cx+meter->r[2]*sin(0.7079457-0.7943); meter->dbm03[1].y=meter->cy-meter->r[2]*cos(0.7079457-0.7943); meter->dbm03[2].x=meter->cx+meter->r[3]*sin(0.7079457-0.7943); meter->dbm03[2].y=meter->cy-meter->r[3]*cos(0.7079457-0.7943); meter->dbm02[0].x=meter->cx+meter->r[1]*sin(0.7943282-0.7943); meter->dbm02[0].y=meter->cy-meter->r[1]*cos(0.7943282-0.7943); meter->dbm02[1].x=meter->cx+meter->r[2]*sin(0.7943282-0.7943); meter->dbm02[1].y=meter->cy-meter->r[2]*cos(0.7943282-0.7943); meter->dbm02[2].x=meter->cx+meter->r[3]*sin(0.7943282-0.7943); meter->dbm02[2].y=meter->cy-meter->r[3]*cos(0.7943282-0.7943); meter->dbm01[0].x=meter->cx+meter->r[1]*sin(0.8912509-0.7943); meter->dbm01[0].y=meter->cy-meter->r[1]*cos(0.8912509-0.7943); meter->dbm01[1].x=meter->cx+meter->r[2]*sin(0.8912509-0.7943); meter->dbm01[1].y=meter->cy-meter->r[2]*cos(0.8912509-0.7943); meter->dbm01[2].x=meter->cx+meter->r[3]*sin(0.8912509-0.7943); meter->dbm01[2].y=meter->cy-meter->r[3]*cos(0.8912509-0.7943); meter->db00[0].x=meter->cx+meter->r[1]*sin(1.0-0.7943); meter->db00[0].y=meter->cy-meter->r[1]*cos(1.0-0.7943); meter->db00[1].x=meter->cx+meter->r[2]*sin(1.0-0.7943); meter->db00[1].y=meter->cy-meter->r[2]*cos(1.0-0.7943); meter->db00[2].x=meter->cx+meter->r[3]*sin(1.0-0.7943); meter->db00[2].y=meter->cy-meter->r[3]*cos(1.0-0.7943); meter->dbp01[0].x=meter->cx+meter->r[1]*sin(1.1220184-0.7943); meter->dbp01[0].y=meter->cy-meter->r[1]*cos(1.1220184-0.7943); meter->dbp01[1].x=meter->cx+meter->r[2]*sin(1.1220184-0.7943); meter->dbp01[1].y=meter->cy-meter->r[2]*cos(1.1220184-0.7943); meter->dbp01[2].x=meter->cx+meter->r[3]*sin(1.1220184-0.7943); meter->dbp01[2].y=meter->cy-meter->r[3]*cos(1.1220184-0.7943); meter->dbp02[0].x=meter->cx+meter->r[1]*sin(1.2589254-0.7943); meter->dbp02[0].y=meter->cy-meter->r[1]*cos(1.2589254-0.7943); meter->dbp02[1].x=meter->cx+meter->r[2]*sin(1.2589254-0.7943); meter->dbp02[1].y=meter->cy-meter->r[2]*cos(1.2589254-0.7943); meter->dbp02[2].x=meter->cx+meter->r[3]*sin(1.2589254-0.7943); meter->dbp02[2].y=meter->cy-meter->r[3]*cos(1.2589254-0.7943); meter->dbp03[0].x=meter->cx+meter->r[1]*sin(1.4125375-0.7943); meter->dbp03[0].y=meter->cy-meter->r[1]*cos(1.4125375-0.7943); meter->dbp03[1].x=meter->cx+meter->r[2]*sin(1.4125375-0.7943); meter->dbp03[1].y=meter->cy-meter->r[2]*cos(1.4125375-0.7943); meter->dbp03[2].x=meter->cx+meter->r[3]*sin(1.4125375-0.7943); meter->dbp03[2].y=meter->cy-meter->r[3]*cos(1.4125375-0.7943); meter->cp[0].x=60; meter->cp[0].y=104; meter->cp[1].x=166; meter->cp[1].y=104; meter->label_font_size=0; meter->scale_font_size=0; } static void inv_vu_meter_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_VU_METER(widget)); g_return_if_fail(requisition != NULL); requisition->width = 183; requisition->height = 105; } static void inv_vu_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_VU_METER(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_vu_meter_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_VU_METER(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 183; attributes.height = 105; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_vu_meter_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_VU_METER(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_vu_meter_paint(widget,INV_VU_METER_DRAW_ALL); return FALSE; } static void inv_vu_meter_paint(GtkWidget *widget, gint mode) { float rawvalue,value; gint bypass; cairo_t *cr; GtkStyle *style; char label[10]; cairo_text_extents_t extents; bypass = INV_VU_METER(widget)->bypass; rawvalue = INV_VU_METER(widget)->value; value = rawvalue*INV_VU_METER(widget)->scale; style = gtk_widget_get_style(widget); cr = gdk_cairo_create(widget->window); if(INV_VU_METER(widget)->label_font_size==0) { INV_VU_METER(widget)->label_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,9.1,"0"); } if(INV_VU_METER(widget)->scale_font_size==0) { INV_VU_METER(widget)->scale_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,7.1,"0"); } if(mode==INV_VU_METER_DRAW_ALL) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.85, 0.85, 0.85); } else { cairo_set_source_rgb(cr, 1.0, 0.90, 0.65); } cairo_paint(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 104); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 182, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 104); cairo_line_to(cr, 182, 104); cairo_line_to(cr, 182, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_set_line_width(cr,1.5); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.12, 0.12, 0.12); } else { cairo_set_source_rgb(cr, 0.15, 0.12, 0.08); } //VU label cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr,INV_VU_METER(widget)->label_font_size); strcpy(label,"VU"); // cairo_text_extents (cr,label,&extents); cairo_move_to(cr,6,99); cairo_show_text(cr,label); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_VU_METER(widget)->scale_font_size); //scale marks cairo_move_to(cr,INV_VU_METER(widget)->dbm20[0].x,INV_VU_METER(widget)->dbm20[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm20[1].x,INV_VU_METER(widget)->dbm20[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm10[0].x,INV_VU_METER(widget)->dbm10[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm10[1].x,INV_VU_METER(widget)->dbm10[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm07[0].x,INV_VU_METER(widget)->dbm07[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm07[1].x,INV_VU_METER(widget)->dbm07[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm05[0].x,INV_VU_METER(widget)->dbm05[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm05[1].x,INV_VU_METER(widget)->dbm05[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm03[0].x,INV_VU_METER(widget)->dbm03[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm03[1].x,INV_VU_METER(widget)->dbm03[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm02[0].x,INV_VU_METER(widget)->dbm02[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm02[1].x,INV_VU_METER(widget)->dbm02[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbm01[0].x,INV_VU_METER(widget)->dbm01[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbm01[1].x,INV_VU_METER(widget)->dbm01[1].y); cairo_stroke(cr); //arc cairo_set_line_width(cr,2); cairo_arc(cr,INV_VU_METER(widget)->cx,INV_VU_METER(widget)->cy,INV_VU_METER(widget)->r[1],INV_VU_METER(widget)->a[0],INV_VU_METER(widget)->a[1]); cairo_stroke(cr); //+labels strcpy(label,"20"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm20[2].x-extents.width,INV_VU_METER(widget)->dbm20[2].y); cairo_show_text(cr,label); strcpy(label,"10"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm10[2].x-extents.width,INV_VU_METER(widget)->dbm10[2].y); cairo_show_text(cr,label); strcpy(label,"7"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm07[2].x-extents.width,INV_VU_METER(widget)->dbm07[2].y); cairo_show_text(cr,label); strcpy(label,"5"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm05[2].x-extents.width,INV_VU_METER(widget)->dbm05[2].y); cairo_show_text(cr,label); strcpy(label,"3"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm03[2].x-extents.width,INV_VU_METER(widget)->dbm03[2].y); cairo_show_text(cr,label); strcpy(label,"2"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,INV_VU_METER(widget)->dbm02[2].x-(extents.width/2),INV_VU_METER(widget)->dbm02[2].y); cairo_show_text(cr,label); strcpy(label,"1"); cairo_move_to(cr,INV_VU_METER(widget)->dbm01[2].x,INV_VU_METER(widget)->dbm01[2].y); cairo_show_text(cr,label); // minus sign cairo_rectangle(cr,6,11,12,2); cairo_fill(cr); //scale marks cairo_set_line_width(cr,1.5); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.39, 0.39, 0.39); } else { cairo_set_source_rgb(cr, 0.80, 0.22, 0.15); } cairo_move_to(cr,INV_VU_METER(widget)->db00[0].x,INV_VU_METER(widget)->db00[0].y); cairo_line_to(cr,INV_VU_METER(widget)->db00[1].x,INV_VU_METER(widget)->db00[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbp01[0].x,INV_VU_METER(widget)->dbp01[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbp01[1].x,INV_VU_METER(widget)->dbp01[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbp02[0].x,INV_VU_METER(widget)->dbp02[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbp02[1].x,INV_VU_METER(widget)->dbp02[1].y); cairo_move_to(cr,INV_VU_METER(widget)->dbp03[0].x,INV_VU_METER(widget)->dbp03[0].y); cairo_line_to(cr,INV_VU_METER(widget)->dbp03[1].x,INV_VU_METER(widget)->dbp03[1].y); cairo_stroke(cr); //arc cairo_set_line_width(cr,4); cairo_arc(cr,INV_VU_METER(widget)->cx,INV_VU_METER(widget)->cy,INV_VU_METER(widget)->r[1]+1,INV_VU_METER(widget)->a[1],INV_VU_METER(widget)->a[2]); cairo_stroke(cr); //+labels strcpy(label,"0"); cairo_move_to(cr,INV_VU_METER(widget)->db00[2].x,INV_VU_METER(widget)->db00[2].y); cairo_show_text(cr,label); strcpy(label,"1"); cairo_move_to(cr,INV_VU_METER(widget)->dbp01[2].x,INV_VU_METER(widget)->dbp01[2].y); cairo_show_text(cr,label); strcpy(label,"2"); cairo_move_to(cr,INV_VU_METER(widget)->dbp02[2].x,INV_VU_METER(widget)->dbp02[2].y); cairo_show_text(cr,label); strcpy(label,"3"); cairo_move_to(cr,INV_VU_METER(widget)->dbp03[2].x,INV_VU_METER(widget)->dbp03[2].y); cairo_show_text(cr,label); //plus sign cairo_rectangle(cr,166,11,12,2); cairo_fill(cr); cairo_rectangle(cr,171,6,2,12); cairo_fill(cr); } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.85, 0.85, 0.85); } else { cairo_set_source_rgb(cr, 1.0, 0.90, 0.65); } cairo_move_to(cr,INV_VU_METER(widget)->cp[0].x,INV_VU_METER(widget)->cp[0].y); cairo_arc(cr,INV_VU_METER(widget)->cx,INV_VU_METER(widget)->cy,INV_VU_METER(widget)->r[0]+1,INV_VU_METER(widget)->a[3],INV_VU_METER(widget)->a[4]); cairo_line_to(cr,INV_VU_METER(widget)->cp[1].x,INV_VU_METER(widget)->cp[1].y); cairo_line_to(cr,INV_VU_METER(widget)->cp[0].x,INV_VU_METER(widget)->cp[0].y); cairo_fill_preserve(cr); cairo_clip(cr); cairo_set_line_width(cr,1.5); cairo_set_source_rgb(cr, 0, 0, 0); if(value < 1.5886) { cairo_move_to(cr,INV_VU_METER(widget)->cx,INV_VU_METER(widget)->cy); cairo_line_to(cr,INV_VU_METER(widget)->cx+(INV_VU_METER(widget)->r[0]*sin(value-0.7943)), INV_VU_METER(widget)->cy-(INV_VU_METER(widget)->r[0]*cos(value-0.7943)) ); } else { cairo_curve_to(cr,INV_VU_METER(widget)->cx, INV_VU_METER(widget)->cy, INV_VU_METER(widget)->cx+(INV_VU_METER(widget)->r[0]*2*sin(value-0.7943)/3), INV_VU_METER(widget)->cy-(INV_VU_METER(widget)->r[0]*2*cos(value-0.7943)/3), INV_VU_METER(widget)->cx+(INV_VU_METER(widget)->r[0]*0.7133), INV_VU_METER(widget)->cy-(INV_VU_METER(widget)->r[0]*0.7008) ); } cairo_stroke(cr); cairo_destroy(cr); INV_VU_METER(widget)->lastvalue=rawvalue; } static void inv_vu_meter_destroy(GtkObject *object) { InvVuMeter *meter; InvVuMeterClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_VU_METER(object)); meter = INV_VU_METER(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-vu.h0000664000175000017500000000415411251515772023723 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __VU_METER_H #define __VU_METER_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_VU_METER_DRAW_ALL 0 #define INV_VU_METER_DRAW_DATA 1 #define INV_VU_METER(obj) GTK_CHECK_CAST(obj, inv_vu_meter_get_type (), InvVuMeter) #define INV_VU_METER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_vu_meter_get_type(), InvVuMeterClass) #define INV_IS_VU_METER(obj) GTK_CHECK_TYPE(obj, inv_vu_meter_get_type()) typedef struct _InvVuMeter InvVuMeter; typedef struct _InvVuMeterClass InvVuMeterClass; struct _InvVuMeter { GtkWidget widget; gint bypass; float value; float lastvalue; gint headroom; float scale; float cx,cy; float r[4],a[5]; struct point2D dbm20[3]; struct point2D dbm10[3]; struct point2D dbm07[3]; struct point2D dbm05[3]; struct point2D dbm03[3]; struct point2D dbm02[3]; struct point2D dbm01[3]; struct point2D db00[3]; struct point2D dbp01[3]; struct point2D dbp02[3]; struct point2D dbp03[3]; struct point2D cp[2]; gint label_font_size,scale_font_size; }; struct _InvVuMeterClass { GtkWidgetClass parent_class; }; GtkType inv_vu_meter_get_type(void); GtkWidget * inv_vu_meter_new(); void inv_vu_meter_set_bypass(InvVuMeter *meter, gint num); void inv_vu_meter_set_value(InvVuMeter *meter, float num); void inv_vu_meter_set_headroom(InvVuMeter *meter, gint num); G_END_DECLS #endif /* __VU_METER_VU_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/knob.c0000664000175000017500000006171411251515772023110 0ustar alessioalessio/* This widget provides knobs (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "math.h" #include "string.h" #include "widgets.h" #include "knob.h" #include "knob-img_small.xpm" #include "knob-img_medium.xpm" #include "knob-img_large.xpm" static void inv_knob_class_init(InvKnobClass *klass); static void inv_knob_init(InvKnob *knob); static void inv_knob_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_knob_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_knob_realize(GtkWidget *widget); static gboolean inv_knob_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_knob_paint(GtkWidget *widget, gint mode); static void inv_knob_destroy(GtkObject *object); static gboolean inv_knob_button_press_event (GtkWidget *widget, GdkEventButton *event); static gboolean inv_knob_motion_notify_event(GtkWidget *widget, GdkEventMotion *event); static gboolean inv_knob_button_release_event (GtkWidget *widget, GdkEventButton *event); static void inv_knob_label(gint mode, char *label, char *units, gint human, float value); static void inv_knob_label_pan(char *label, float value, float min, float max); static float inv_knob_label_set_dp(float value); static float inv_marking_to_value(float mark, gint curve, float min, float max); static float inv_value_to_angle(float value, gint curve, float min, float max); static float inv_value_from_motion(float x_delta, float y_delta, float current, gint curve, float min, float max); GtkType inv_knob_get_type(void) { static GType inv_knob_type = 0; char *name; int i; if (!inv_knob_type) { static const GTypeInfo type_info = { sizeof(InvKnobClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_knob_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvKnob), 0, /* n_preallocs */ (GInstanceInitFunc)inv_knob_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvKnob-%p-%d", inv_knob_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_knob_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_knob_type; } void inv_knob_set_bypass(InvKnob *knob, gint num) { knob->bypass = num; } void inv_knob_set_size(InvKnob *knob, gint num) { knob->size = num; } void inv_knob_set_curve(InvKnob *knob, gint num) { knob->curve = num; } void inv_knob_set_markings(InvKnob *knob, gint num) { knob->markings = num; } void inv_knob_set_custom(InvKnob *knob, gint pos, char *label) { switch(pos) { case 0: strncpy(knob->clow, label, 9); break; case 1: strncpy(knob->cmid, label, 9); break; case 2: strncpy(knob->chigh, label, 9); break; } } void inv_knob_set_highlight(InvKnob *knob, gint num) { knob->highlight = num; } void inv_knob_set_human(InvKnob *knob) { knob->human=1; } void inv_knob_set_units(InvKnob *knob, char *units) { strncpy(knob->units, units, 4); } void inv_knob_set_min(InvKnob *knob, float num) { knob->min = num; } void inv_knob_set_max(InvKnob *knob, float num) { knob->max = num; } void inv_knob_set_value(InvKnob *knob, float num) { if(num < knob->min) knob->value = knob->min; else if(num > knob->max) knob->value = knob->min; else knob->value = num; if(knob->value != knob->lastvalue) { if(GTK_WIDGET_REALIZED(knob)) inv_knob_paint(GTK_WIDGET(knob),INV_KNOB_DRAW_DATA); } } void inv_knob_set_tooltip(InvKnob *knob, gchar *tip) { gtk_widget_set_tooltip_markup(GTK_WIDGET(knob),tip); } float inv_knob_get_value(InvKnob *knob) { return knob->value; } GtkWidget * inv_knob_new() { return GTK_WIDGET(gtk_type_new(inv_knob_get_type())); } static void inv_knob_class_init(InvKnobClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_knob_realize; widget_class->size_request = inv_knob_size_request; widget_class->size_allocate = inv_knob_size_allocate; widget_class->expose_event = inv_knob_expose; widget_class->button_press_event = inv_knob_button_press_event; widget_class->motion_notify_event = inv_knob_motion_notify_event; widget_class->button_release_event = inv_knob_button_release_event; object_class->destroy = inv_knob_destroy; } static void inv_knob_init(InvKnob *knob) { knob->bypass = INV_PLUGIN_ACTIVE; knob->size = INV_KNOB_SIZE_MEDIUM; knob->curve = INV_KNOB_CURVE_LINEAR; knob->markings = INV_KNOB_MARKINGS_5; knob->highlight = INV_KNOB_HIGHLIGHT_L; strcpy(knob->units,""); strcpy(knob->clow,""); strcpy(knob->cmid,""); strcpy(knob->chigh,""); knob->human = 0; knob->min = 0.0; knob->max = 1.0; knob->value = 0.5; knob->lastvalue = 0.5; knob->click_x =0; knob->click_y =0; knob->img_small=gdk_pixbuf_new_from_xpm_data((const char **)knob_img_small_xpm); knob->img_med=gdk_pixbuf_new_from_xpm_data((const char **)knob_img_medium_xpm); knob->img_large=gdk_pixbuf_new_from_xpm_data((const char **)knob_img_large_xpm); knob->font_size=0; GTK_WIDGET_SET_FLAGS (GTK_WIDGET(knob), GTK_CAN_FOCUS); } static void inv_knob_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_KNOB(widget)); g_return_if_fail(requisition != NULL); requisition->width = INV_KNOB (widget)->size+4; switch(INV_KNOB (widget)->size) { case INV_KNOB_SIZE_SMALL: requisition->height = INV_KNOB (widget)->size+50; break; case INV_KNOB_SIZE_MEDIUM: requisition->height = INV_KNOB (widget)->size+56; break; case INV_KNOB_SIZE_LARGE: default: requisition->height = INV_KNOB (widget)->size+62; break; } } static void inv_knob_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_KNOB(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_knob_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_KNOB(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = INV_KNOB (widget)->size + 4; switch(INV_KNOB (widget)->size) { case INV_KNOB_SIZE_SMALL: attributes.height = INV_KNOB (widget)->size + 50; break; case INV_KNOB_SIZE_MEDIUM: attributes.height = INV_KNOB (widget)->size + 56; break; case INV_KNOB_SIZE_LARGE: default: attributes.height = INV_KNOB (widget)->size + 62; break; } attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_knob_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_KNOB(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_knob_paint(widget,INV_KNOB_DRAW_ALL); return FALSE; } static void inv_knob_paint(GtkWidget *widget, gint mode) { cairo_t *cr; gint bypass; gint size; gint curve; gint markings; gint highlight; gint human; char *units; char *clow; char *cmid; char *chigh; float min; float max; float value,lastvalue; GdkPixbuf *img; GtkStateType state; GtkStyle *style; cairo_pattern_t *pat; gint i; float xc,yc,r,ll,ls,tb,angle; gint fontheight; char label[20]; cairo_text_extents_t extents; cr = gdk_cairo_create(widget->window); state = GTK_WIDGET_STATE(widget); style = gtk_widget_get_style(widget); bypass = INV_KNOB(widget)->bypass; size = INV_KNOB(widget)->size; curve = INV_KNOB(widget)->curve; markings = INV_KNOB(widget)->markings; highlight = INV_KNOB(widget)->highlight; human = INV_KNOB(widget)->human; units = INV_KNOB(widget)->units; clow = INV_KNOB(widget)->clow; cmid = INV_KNOB(widget)->cmid; chigh = INV_KNOB(widget)->chigh; min = INV_KNOB(widget)->min; max = INV_KNOB(widget)->max; value = INV_KNOB(widget)->value; lastvalue = INV_KNOB(widget)->lastvalue; xc=(size/2)+2; r=size/2; switch(size) { case INV_KNOB_SIZE_SMALL: yc=(size/2)+19; fontheight=5; ls=3; ll=7; tb=11; img = INV_KNOB(widget)->img_small; break; case INV_KNOB_SIZE_MEDIUM: yc=(size/2)+22; fontheight=6; ls=5; ll=9; tb=12; img = INV_KNOB(widget)->img_med; break; case INV_KNOB_SIZE_LARGE: default: yc=(size/2)+25; fontheight=7; ls=7; ll=11; tb=13; img = INV_KNOB(widget)->img_large; break; } if(INV_KNOB(widget)->font_size==0) { INV_KNOB(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,(double)fontheight+0.1,"0"); } /* sanity check - ardour 2.7 doesn't initialise control values properly */ if(value < min) value=min; else if (value > max) value=max; if(mode==INV_KNOB_DRAW_ALL) { gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]); cairo_paint(cr); cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND); if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } if(markings==INV_KNOB_MARKINGS_3 || markings==INV_KNOB_MARKINGS_4 || markings==INV_KNOB_MARKINGS_5 || markings==INV_KNOB_MARKINGS_CUST12) { for(i=0;i<=12;i++) { cairo_move_to(cr,xc+(r-6)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r-6)*cos((INV_PI/3)+(i*INV_PI/9))); if(i==0 || i==12) { /* bottom L & R */ cairo_line_to(cr,xc+r*sin((INV_PI/3)+(i*INV_PI/9)),yc+r*cos((INV_PI/3)+(i*INV_PI/9))); cairo_line_to(cr,xc+r*sin((INV_PI/3)+(i*INV_PI/9)),yc+r-2); cairo_set_line_width(cr,2); cairo_stroke(cr); } else if ((i==3 || i==9) && markings==INV_KNOB_MARKINGS_5) { /*top L & R for M5 */ cairo_line_to(cr,xc+r*sin((INV_PI/3)+(i*INV_PI/9)),yc+r*cos((INV_PI/3)+(i*INV_PI/9))); cairo_line_to(cr,xc+r*sin((INV_PI/3)+(i*INV_PI/9)),yc-r+2); cairo_set_line_width(cr,2); cairo_stroke(cr); } else if ((i==4 || i==8) && markings==INV_KNOB_MARKINGS_4) { /*top L & R for M4 */ cairo_line_to(cr,xc+(r+ls)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r+ls)*cos((INV_PI/3)+(i*INV_PI/9))); cairo_line_to(cr,xc+(r+ls)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r+ls)*cos((INV_PI/3)+(i*INV_PI/9))-(ls+1)); cairo_set_line_width(cr,2); cairo_stroke(cr); } else if (i==6 && markings==INV_KNOB_MARKINGS_5) { /*top M5 */ cairo_line_to(cr,xc+(r+ll)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r+ll)*cos((INV_PI/3)+(i*INV_PI/9))); cairo_set_line_width(cr,2); cairo_stroke(cr); } else if (i==6 && (markings==INV_KNOB_MARKINGS_3 || markings==INV_KNOB_MARKINGS_CUST12)){ /*top M3 */ cairo_line_to(cr,xc+(r+ls)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r+ls)*cos((INV_PI/3)+(i*INV_PI/9))); cairo_set_line_width(cr,2); cairo_stroke(cr); } else { /* all others */ cairo_line_to(cr,xc+(r-2)*sin((INV_PI/3)+(i*INV_PI/9)),yc+(r-2)*cos((INV_PI/3)+(i*INV_PI/9))); cairo_set_line_width(cr,1.3); cairo_stroke(cr); } } } else { /* pan, cust10 & 10 */ for(i=0;i<=10;i++) { cairo_move_to(cr,xc+(r-6)*sin((INV_PI/3)+(4*i*INV_PI/30)),yc+(r-6)*cos((INV_PI/3)+(4*i*INV_PI/30))); if(i==0 || i==10) { /* bottom L & R */ cairo_line_to(cr,xc+r*sin((INV_PI/3)+(4*i*INV_PI/30)),yc+r*cos((INV_PI/3)+(4*i*INV_PI/30))); cairo_line_to(cr,xc+r*sin((INV_PI/3)+(4*i*INV_PI/30)),yc+r-2); cairo_set_line_width(cr,2); cairo_stroke(cr); } else if (i==5){ /*top */ cairo_line_to(cr,xc+(r+ls)*sin((INV_PI/3)+(4*i*INV_PI/30)),yc+(r+ls)*cos((INV_PI/3)+(4*i*INV_PI/30))); cairo_set_line_width(cr,2); cairo_stroke(cr); } else { /* all others */ cairo_line_to(cr,xc+(r-2)*sin((INV_PI/3)+(4*i*INV_PI/30)),yc+(r-2)*cos((INV_PI/3)+(4*i*INV_PI/30))); cairo_set_line_width(cr,1.3); cairo_stroke(cr); } } } cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_KNOB(widget)->font_size); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[state]); } /* bottom left */ switch(markings) { case INV_KNOB_MARKINGS_PAN: switch(size) { case INV_KNOB_SIZE_MEDIUM: case INV_KNOB_SIZE_LARGE: strcpy(label,"Left"); break; case INV_KNOB_SIZE_SMALL: default: strcpy(label,"L"); break; } break; case INV_KNOB_MARKINGS_CUST10: case INV_KNOB_MARKINGS_CUST12: strcpy(label,clow); break; case INV_KNOB_MARKINGS_3: case INV_KNOB_MARKINGS_4: case INV_KNOB_MARKINGS_5: case INV_KNOB_MARKINGS_10: inv_knob_label(0,label, units,human, min); break; } cairo_move_to(cr,1,yc+r+8); cairo_show_text(cr,label); /* bottom right */ switch(markings) { case INV_KNOB_MARKINGS_PAN: switch(size) { case INV_KNOB_SIZE_MEDIUM: case INV_KNOB_SIZE_LARGE: strcpy(label,"Right"); break; case INV_KNOB_SIZE_SMALL: default: strcpy(label,"R"); break; } break; case INV_KNOB_MARKINGS_CUST10: case INV_KNOB_MARKINGS_CUST12: strcpy(label,chigh); break; case INV_KNOB_MARKINGS_3: case INV_KNOB_MARKINGS_4: case INV_KNOB_MARKINGS_5: case INV_KNOB_MARKINGS_10: inv_knob_label(0,label, units, human, max); break; } cairo_text_extents (cr,label,&extents); cairo_move_to(cr,size+1-extents.width,yc+r+8); cairo_show_text(cr,label); /* top */ if(markings != INV_KNOB_MARKINGS_4) { switch(markings) { case INV_KNOB_MARKINGS_PAN: strcpy(label,"Centre"); break; case INV_KNOB_MARKINGS_CUST10: case INV_KNOB_MARKINGS_CUST12: strcpy(label,cmid); break; case INV_KNOB_MARKINGS_3: case INV_KNOB_MARKINGS_5: case INV_KNOB_MARKINGS_10: inv_knob_label(0,label, units, human, inv_marking_to_value(1.0/2.0, curve, min, max)); break; } cairo_text_extents (cr,label,&extents); switch(markings) { case INV_KNOB_MARKINGS_PAN: case INV_KNOB_MARKINGS_3: case INV_KNOB_MARKINGS_10: case INV_KNOB_MARKINGS_CUST10: case INV_KNOB_MARKINGS_CUST12: cairo_move_to(cr,xc-(extents.width/2)-1,(2*fontheight)+1); break; case INV_KNOB_MARKINGS_5: cairo_move_to(cr,xc-(extents.width/2)-1,fontheight+3); break; } cairo_show_text(cr,label); } /* M5 top left */ if(markings==INV_KNOB_MARKINGS_5) { inv_knob_label(0,label, units,human, inv_marking_to_value(1.0/4.0, curve, min, max)); cairo_move_to(cr,1,yc-r-1); cairo_show_text(cr,label); } /* M5 top right */ if(markings==INV_KNOB_MARKINGS_5) { inv_knob_label(0,label, units,human, inv_marking_to_value(3.0/4.0, curve, min, max)); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,size+1-extents.width,yc-r-1); cairo_show_text(cr,label); } /* M4 top left */ if(markings==INV_KNOB_MARKINGS_4) { inv_knob_label(0,label, units,human, inv_marking_to_value(1.0/3.0, curve, min, max)); cairo_move_to(cr,1,yc-r-(ls+1)); cairo_show_text(cr,label); } /* M4 top right */ if(markings==INV_KNOB_MARKINGS_4) { inv_knob_label(0,label, units,human, inv_marking_to_value(2.0/3.0, curve, min, max)); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,size+1-extents.width,yc-r-(ls+1)); cairo_show_text(cr,label); } cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 3, yc+r+ll+tb+10); cairo_line_to(cr, 3, yc+r+ll+8); cairo_line_to(cr, 2*r+1, yc+r+ll+8); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 3, yc+r+ll+tb+10); cairo_line_to(cr, 2*r+1, yc+r+ll+tb+10); cairo_line_to(cr, 2*r+1, yc+r+ll+8); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); } if(value!=lastvalue || mode==INV_KNOB_DRAW_ALL) { if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->base[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->base[state]); } cairo_rectangle(cr, 4, yc+r+ll+9, 2*r-4, tb); cairo_fill(cr); cairo_set_font_size(cr,INV_KNOB(widget)->font_size); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->text[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->text[state]); } switch(markings) { case INV_KNOB_MARKINGS_3: case INV_KNOB_MARKINGS_4: case INV_KNOB_MARKINGS_5: case INV_KNOB_MARKINGS_10: case INV_KNOB_MARKINGS_CUST10: case INV_KNOB_MARKINGS_CUST12: inv_knob_label(1,label, units, human, value); break; case INV_KNOB_MARKINGS_PAN: inv_knob_label_pan(label, value, min, max); break; } cairo_text_extents (cr,label,&extents); cairo_move_to(cr,xc-(extents.width/2)-1,yc+r+ll+11-extents.y_bearing); cairo_show_text(cr,label); cairo_new_path(cr); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]); cairo_arc(cr,xc,yc,r-7.5,0,2*INV_PI); cairo_stroke(cr); cairo_save(cr); angle=inv_value_to_angle(value,curve,min,max); cairo_translate(cr,xc,yc); cairo_rotate(cr,angle+0.03); cairo_arc(cr,0,0,r-9,0,2*INV_PI); cairo_clip(cr); gdk_cairo_set_source_pixbuf(cr,img, -(r-9), -(r-9)); cairo_paint(cr); cairo_restore(cr); pat = cairo_pattern_create_linear (0.0, 0.0, xc*2, yc*2); cairo_pattern_add_color_stop_rgba (pat, 0.0, 0.00, 0.00, 1.00, 1); cairo_pattern_add_color_stop_rgba (pat, 0.32, 0.91, 0.89, 0.83, 1); cairo_pattern_add_color_stop_rgba (pat, 0.5, 0.43, 0.32, 0.26, 1); cairo_pattern_add_color_stop_rgba (pat, 0.68, 0.10, 0.05, 0.04, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.00, 0.00, 1.00, 1); cairo_set_source (cr, pat); cairo_set_line_width(cr,2.0); cairo_arc(cr,xc,yc,r-8.5,0,2*INV_PI); cairo_stroke(cr); INV_KNOB(widget)->lastvalue=value; } cairo_destroy(cr); } static void inv_knob_destroy(GtkObject *object) { InvKnob *knob; InvKnobClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_KNOB(object)); knob = INV_KNOB(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static gboolean inv_knob_button_press_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_KNOB(widget)); g_object_set(G_OBJECT(widget),"has-tooltip",FALSE,NULL); gtk_widget_set_state(widget,GTK_STATE_ACTIVE); gtk_widget_grab_focus(widget); INV_KNOB(widget)->click_x=event->x; INV_KNOB(widget)->click_y=event->y; inv_knob_paint(widget,INV_KNOB_DRAW_ALL); return TRUE; } static gboolean inv_knob_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) { g_assert(INV_IS_KNOB(widget)); if((GTK_WIDGET (widget)->state)==GTK_STATE_ACTIVE) { INV_KNOB(widget)->value = inv_value_from_motion(INV_KNOB(widget)->click_x-event->x, INV_KNOB(widget)->click_y-event->y, INV_KNOB(widget)->value, INV_KNOB(widget)->curve, INV_KNOB(widget)->min, INV_KNOB(widget)->max ); INV_KNOB(widget)->click_y = event->y; inv_knob_paint(widget,INV_KNOB_DRAW_DATA); return FALSE; //let the after signal run } else { return TRUE; } } static gboolean inv_knob_button_release_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_KNOB(widget)); gtk_widget_set_state(widget,GTK_STATE_NORMAL); g_object_set(G_OBJECT(widget),"has-tooltip",TRUE,NULL); inv_knob_paint(widget,INV_KNOB_DRAW_ALL); return TRUE; } static void inv_knob_label(gint mode, char *label, char *units, gint human, float value) { float rounded; if(mode==0) { if(human==1) { if(fabs(value)<0.001) { sprintf(label,"%0.0fµ%s",value*1000000,units); } else if(fabs(value)<1) { sprintf(label,"%0.0fm%s",value*1000,units); } else if(fabs(value<1000)) { sprintf(label,"%0.0f%s",value,units); } else if(fabs(value<1000000)) { sprintf(label,"%0.0fk%s",value/1000,units); } else { sprintf(label,"%0.0fM%s",value/1000000,units); } } else { sprintf(label,"%0.0f%s",value,units); } } else { if(human==1) { if(fabs(value)<0.001) { rounded=inv_knob_label_set_dp(value*1000000); sprintf(label,"%0.3g µ%s",rounded,units); } else if(fabs(value)<1) { rounded=inv_knob_label_set_dp(value*1000); sprintf(label,"%0.3g m%s",rounded,units); } else if(fabs(value<1000)) { rounded=inv_knob_label_set_dp(value); sprintf(label,"%0.3g %s",rounded,units); } else if(fabs(value<1000000)) { rounded=inv_knob_label_set_dp(value/1000); sprintf(label,"%0.3g k%s",rounded,units); } else { rounded=inv_knob_label_set_dp(value/1000000); sprintf(label,"%0.3g M%s",rounded,units); } } else { rounded=inv_knob_label_set_dp(value); sprintf(label,"%0.3g %s",rounded,units); } } } static void inv_knob_label_pan(char *label, float value, float min, float max) { float center; gint pan; center = (max+min)/2; if(value < center) /* left */ { pan=-100 * (value/(center-min)); if(pan==0) { sprintf(label,"Centre"); } else { sprintf(label,"%i%% L",pan); } } else { /* right */ pan=100 * (value/(max-center)); if(pan==0) { sprintf(label,"Centre"); } else { sprintf(label,"%i%% R",pan); } } } static float inv_knob_label_set_dp(float value) { float exponent,newval; exponent= value==0 ? 0 : log10(fabs(value)); if(exponent<1) { newval=floor(value*100)/100; } else if(exponent<2) { newval=floor(value*10)/10; } else { newval=floor(value); } return newval; } static float inv_marking_to_value(float mark, gint curve, float min, float max) { float value; switch(curve) { case INV_KNOB_CURVE_LOG: value=pow(10,log10(min)+(mark*(log10(max)-log10(min)))); break; case INV_KNOB_CURVE_QUAD: value= mark < 0.5 ? ((min+max)/2) - (pow((2*mark)-1,2) * ((max-min)/2)): ((min+max)/2) + (pow((2*mark)-1,2) * ((max-min)/2)); break; case INV_KNOB_CURVE_LINEAR: default: value = min + (max-min) * mark; break; } return value; } static float inv_value_to_angle(float value, gint curve, float min, float max) { float angle; switch(curve) { case INV_KNOB_CURVE_LOG: angle=(4.0*INV_PI*(log10(value)-log10(min)))/(3*(log10(max)-log10(min))) ; break; case INV_KNOB_CURVE_QUAD: angle= value < (max+min)/2 ? 4.0*INV_PI*(1-pow(((min+max)-(2*value))/(max-min),0.5))/6 : 4.0*INV_PI*(pow(((2*value)-(min+max))/(max-min),0.5)+1)/6 ; break; case INV_KNOB_CURVE_LINEAR: default: angle = (4.0*INV_PI*(value-min))/(3*(max-min)) ; break; } return angle; } static float inv_value_from_motion(float x_delta, float y_delta, float current, gint curve, float min, float max) { float sens,value,pos; sens=1/(75*(1+fabs(x_delta/10))); switch(curve) { case INV_KNOB_CURVE_LOG: value = pow(10,log10(current) + (y_delta * sens * (log10(max)-log10(min)))); break; case INV_KNOB_CURVE_QUAD: pos= current < (max+min)/2 ? (1-pow(((min+max)-(2*current))/(max-min),0.5))/2 : (pow(((2*current)-(min+max))/(max-min),0.5)+1)/2 ; value= pos + (y_delta * sens) < 0.5 ? ((min+max)/2) - (pow((2*(pos + (y_delta * sens)))-1,2) * ((max-min)/2)): ((min+max)/2) + (pow((2*(pos + (y_delta * sens)))-1,2) * ((max-min)/2)); break; case INV_KNOB_CURVE_LINEAR: default: value = current + (y_delta * sens * (max-min)); break; } if(value < min) value = min; if(value > max) value = max; return value; } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-ErReverb.h0000664000175000017500000000526611251515772025343 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DISPLAY_ERR_H #define __DISPLAY_ERR_H #include #include #include "widgets.h" #include "../../plugin/library/common.h" G_BEGIN_DECLS #define INV_DISPLAY_ERR_DRAW_ALL 0 #define INV_DISPLAY_ERR_DRAW_DATA 1 #define INV_DISPLAY_ERR_ROOM_LENGTH 0 #define INV_DISPLAY_ERR_ROOM_WIDTH 1 #define INV_DISPLAY_ERR_ROOM_HEIGHT 2 #define INV_DISPLAY_ERR_LR 0 #define INV_DISPLAY_ERR_FB 1 #define INV_DISPLAY_ERR_DOT_NONE 0 #define INV_DISPLAY_ERR_DOT_SOURCE 1 #define INV_DISPLAY_ERR_DOT_DEST 2 #define INV_DISPLAY_ERR(obj) GTK_CHECK_CAST(obj, inv_display_err_get_type (), InvDisplayErr) #define INV_DISPLAY_ERR_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_display_err_get_type(), InvDisplayErrClass) #define INV_IS_DISPLAY_ERR(obj) GTK_CHECK_TYPE(obj, inv_display_err_get_type()) typedef struct _InvDisplayErr InvDisplayErr; typedef struct _InvDisplayErrClass InvDisplayErrClass; struct _InvDisplayErr { GtkWidget widget; gint active_dot; gint bypass; float room[3]; float source[2]; float dest[2]; float diffusion; float Lastroom[3]; float Lastsource[2]; float Lastdest[2]; float Lastdiffusion; struct ERunit * er; gint er_size; float header_font_size,info_font_size; }; struct _InvDisplayErrClass { GtkWidgetClass parent_class; }; GtkType inv_display_err_get_type(void); GtkWidget * inv_display_err_new(); void inv_display_err_set_bypass(InvDisplayErr *displayErr, gint num); gint inv_display_err_get_active_dot(InvDisplayErr *displayErr); float inv_display_err_get_source(InvDisplayErr *displayErr, gint axis); float inv_display_err_get_dest(InvDisplayErr *displayErr, gint axis); void inv_display_err_set_room(InvDisplayErr *displayErr, gint axis, float num); void inv_display_err_set_source(InvDisplayErr *displayErr, gint axis, float num); void inv_display_err_set_dest(InvDisplayErr *displayErr, gint axis, float num); void inv_display_err_set_diffusion(InvDisplayErr *displayErr, float num); G_END_DECLS #endif /* __DISPLAY_ERR_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-FrequencyGain.c0000664000175000017500000004437211251515772026363 0ustar alessioalessio/* This widget provides a display for filters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "display-FrequencyGain.h" static void inv_display_fg_class_init(InvDisplayFGClass *klass); static void inv_display_fg_init(InvDisplayFG *displayFG); static void inv_display_fg_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_display_fg_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_display_fg_realize(GtkWidget *widget); static gboolean inv_display_fg_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_display_fg_paint(GtkWidget *widget, gint mode); static void inv_display_fg_destroy(GtkObject *object); static gboolean inv_display_fg_button_press_event(GtkWidget *widget, GdkEventButton *event); static gboolean inv_display_fg_motion_notify_event(GtkWidget *widget, GdkEventMotion *event); static gboolean inv_display_fg_button_release_event(GtkWidget *widget, GdkEventButton *event); float get_x_from_freq(float min, float max, float freq, float range); float get_y_from_gain(float gain); float get_fg_freq_from_x(float min, float max, float x, float range); float get_fg_gain_from_y(float y); gint check_fg_click_on_control(float freq, float gain, float ex, float ey); void get_fg_value_from_motion(float ex, float ey, float *freq, float *gain); GtkType inv_display_fg_get_type(void) { static GtkType inv_display_fg_type = 0; char *name; int i; if (!inv_display_fg_type) { static const GTypeInfo type_info = { sizeof(InvDisplayFGClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_display_fg_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvDisplayFG), 0, /* n_preallocs */ (GInstanceInitFunc)inv_display_fg_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvDisplayFG-%p-%d",inv_display_fg_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_display_fg_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_display_fg_type; } void inv_display_fg_set_bypass(InvDisplayFG *displayFG, gint num) { displayFG->bypass = num; } void inv_display_fg_set_mode(InvDisplayFG *displayFG, gint num) { displayFG->mode = num; } void inv_display_fg_set_freq(InvDisplayFG *displayFG, float num) { if(num<20) displayFG->freq = 20; else if (num <= 20000) displayFG->freq = num; else displayFG->freq = 20000; if(displayFG->freq != displayFG->Lastfreq) { if(GTK_WIDGET_REALIZED(displayFG)) inv_display_fg_paint(GTK_WIDGET(displayFG),INV_DISPLAYFG_DRAW_DATA); } } void inv_display_fg_set_gain(InvDisplayFG *displayFG, float num) { if(num<0) displayFG->gain = 0; else if (num <= 12) displayFG->gain = num; else displayFG->gain = 12; if(displayFG->gain != displayFG->Lastgain) { if(GTK_WIDGET_REALIZED(displayFG)) inv_display_fg_paint(GTK_WIDGET(displayFG),INV_DISPLAYFG_DRAW_DATA); } } float inv_display_fg_get_freq(InvDisplayFG *displayFG) { return displayFG->freq; } float inv_display_fg_get_gain(InvDisplayFG *displayFG) { return displayFG->gain; } GtkWidget * inv_display_fg_new() { return GTK_WIDGET(gtk_type_new(inv_display_fg_get_type())); } static void inv_display_fg_class_init(InvDisplayFGClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_display_fg_realize; widget_class->size_request = inv_display_fg_size_request; widget_class->size_allocate = inv_display_fg_size_allocate; widget_class->expose_event = inv_display_fg_expose; widget_class->button_press_event = inv_display_fg_button_press_event; widget_class->motion_notify_event = inv_display_fg_motion_notify_event; widget_class->button_release_event = inv_display_fg_button_release_event; object_class->destroy = inv_display_fg_destroy; } static void inv_display_fg_init(InvDisplayFG *displayFG) { displayFG->bypass = INV_PLUGIN_ACTIVE; displayFG->mode = INV_DISPLAYFG_MODE_LPF; displayFG->freq = 1000.0; displayFG->gain = 0.0; displayFG->Lastfreq = 1000.0; displayFG->Lastgain = 0.0; displayFG->Laststate = GTK_STATE_NORMAL; displayFG->font_size=0; GTK_WIDGET_SET_FLAGS (GTK_WIDGET(displayFG), GTK_CAN_FOCUS); gtk_widget_set_tooltip_markup(GTK_WIDGET(displayFG),"Description: This shows the effect of the filter across the autio spectrum.\nUsage: Click on the dot and drag to adjust the filter."); } static void inv_display_fg_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_FG(widget)); g_return_if_fail(requisition != NULL); requisition->width = 408; requisition->height = 150; } static void inv_display_fg_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_FG(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_display_fg_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_FG(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 408; attributes.height = 150; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_display_fg_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_DISPLAY_FG(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_display_fg_paint(widget,INV_DISPLAYFG_DRAW_ALL); return FALSE; } static void inv_display_fg_paint(GtkWidget *widget, gint mode) { gint bypass; gint type; float freq,gain; gint i,j,k; float p,x,y,cx,cy; char string[10]; cairo_t *cr; GtkStyle *style; GtkStateType state; state = GTK_WIDGET_STATE(widget); style = gtk_widget_get_style(widget); bypass=INV_DISPLAY_FG(widget)->bypass; type=INV_DISPLAY_FG(widget)->mode; freq=INV_DISPLAY_FG(widget)->freq; gain=INV_DISPLAY_FG(widget)->gain; cr = gdk_cairo_create(widget->window); if(INV_DISPLAY_FG(widget)->font_size==0) { INV_DISPLAY_FG(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } if(mode==INV_DISPLAYFG_DRAW_ALL) { cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 149); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 407, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 149); cairo_line_to(cr, 407, 149); cairo_line_to(cr, 407, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 1, 1, 406, 148 ); cairo_fill(cr); /* horizontal axis */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); } else { cairo_set_source_rgb(cr, 1, 1, 1); } cairo_rectangle(cr, 4, 134, 374, 1); cairo_fill(cr); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_DISPLAY_FG(widget)->font_size); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } for(i=1; i<5;i++) { for(j=1;j<6;j++) { if( j==1 || j==2 || j==5) { p=(float)j*pow(10,(float)i); if(p>=20 && p <= 20000) { switch(i) { case 1: sprintf(string,"%i0Hz",j); break; case 2: sprintf(string,"%i00Hz",j); break; case 3: sprintf(string,"%ikHz",j); break; case 4: sprintf(string,"%i0kHz",j); break; } k= (gint) get_x_from_freq(20.0, 20000.0, p, 358); cairo_move_to(cr,k-4,145); cairo_show_text(cr,string); } } } } /* vertical axis */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); } else { cairo_set_source_rgb(cr, 1, 1, 1); } cairo_rectangle(cr, 377, 4, 1, 131); cairo_fill(cr); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_DISPLAY_FG(widget)->font_size); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } for(i=0;i<11;i+=2) { j=12-(i*6); sprintf(string,"%3idB",j); cairo_move_to(cr,379,11+(i*12)); cairo_show_text(cr,string); } } if(freq!=INV_DISPLAY_FG(widget)->Lastfreq || gain!=INV_DISPLAY_FG(widget)->Lastgain || state!=INV_DISPLAY_FG(widget)->Laststate || mode==INV_DISPLAYFG_DRAW_ALL) { /*graph area */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 4, 4, 373, 130 ); cairo_fill(cr); if(state==GTK_STATE_ACTIVE) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.2); } else { cairo_set_source_rgba(cr, 1.0, 0.1, 0.0, 0.2); } cairo_rectangle(cr, 10, 8.5, 358, 24 ); cairo_fill(cr); } /* horizontal axis except for labeled lines */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.15, 0.15, 0.15); } else { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } for(i=1; i<5;i++) { for(j=1; j<10; j++) { if( !(j==1 || j==2 || j==5)) { p=(float)j*pow(10,(float)i); if(p>=20 && p <= 20000) { k= (gint) get_x_from_freq(20.0, 20000.0, p, 358); cairo_rectangle(cr, k, 4, 1, 130); cairo_fill(cr); } } } } /* vertical axis */ for(i=0;i<11;i++) { switch(i) { case 2: break; case 0: case 4: case 6: case 8: case 10: if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } else { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } cairo_rectangle(cr, 4, 8+(i*12), 373, 1); cairo_fill(cr); break; case 1: case 3: case 5: case 7: case 9: if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.15, 0.15, 0.15); } else { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } cairo_rectangle(cr, 4, 8+(i*12), 373, 1); cairo_fill(cr); break; } } /* horizontal axis labeled lines */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } else { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } for(i=1; i<5;i++) { for(j=1; j<6; j++) { if( j==1 || j==2 || j==5) { p=(float)j*pow(10,(float)i); if(p>=20 && p <= 20000) { k= (gint) get_x_from_freq(20.0, 20000.0, p, 358); cairo_rectangle(cr, k, 4, 1, 130); cairo_fill(cr); } } } } /* 0db line */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } cairo_rectangle(cr, 4, 32, 373, 1); cairo_fill(cr); /* filter area */ cairo_rectangle(cr, 4, 4, 373, 130 ); cairo_clip(cr); /* control circle */ cx=get_x_from_freq(20.0, 20000.0, freq, 358); cy=get_y_from_gain(gain); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.5); cairo_set_line_width(cr,1.0); } else if (state==GTK_STATE_ACTIVE) { cairo_set_source_rgba(cr, 1.0, 0.5, 0.4, 0.75); cairo_set_line_width(cr,1.0); } else { cairo_set_source_rgba(cr, 1.0, 0.1, 0.0, 0.5); cairo_set_line_width(cr,1.0); } cairo_move_to(cr,cx,cy); cairo_arc(cr,cx,cy,4,0,2*INV_PI); cairo_fill(cr); /* now the line */ if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); cairo_set_line_width(cr,1.5); } else if (state==GTK_STATE_ACTIVE) { cairo_set_source_rgb(cr, 0.4, 0.5, 1); cairo_set_line_width(cr,2); } else { cairo_set_source_rgb(cr, 0.0, 0.1, 1); cairo_set_line_width(cr,3); } INV_DISPLAY_FG(widget)->Lastfreq = freq; INV_DISPLAY_FG(widget)->Lastgain = gain; INV_DISPLAY_FG(widget)->Laststate = state; switch(type) { case INV_DISPLAYFG_MODE_LPF: x=get_x_from_freq(20.0, 20000.0, freq*0.3, 358); y=get_y_from_gain(gain); if(x > 4) { cairo_move_to(cr, 4, y); cairo_line_to(cr, x, y); } else { cairo_move_to(cr, x, y); } gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq*0.7, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq*0.9, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); i=0; while(freq < 30000) { freq=freq*1.58; gain=gain-3; x=get_x_from_freq(20.0, 20000.0, freq, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); i++; } break; case INV_DISPLAYFG_MODE_HPF: x=get_x_from_freq(20.0, 20000.0, freq/0.3, 358); y=get_y_from_gain(gain); if(x < 376) { cairo_move_to(cr, 376, y); cairo_line_to(cr, x, y); } else { cairo_move_to(cr, x, y); } gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq/0.7, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq/0.9, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); gain=gain -1; x=get_x_from_freq(20.0, 20000.0, freq, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); i=0; while(freq > 14) { freq=freq/1.58; gain=gain-3; x=get_x_from_freq(20.0, 20000.0, freq, 358); y=get_y_from_gain(gain); cairo_line_to(cr, x, y); i++; } break; } cairo_stroke(cr); } cairo_destroy(cr); } static void inv_display_fg_destroy(GtkObject *object) { InvDisplayFG *displayFG; InvDisplayFGClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_DISPLAY_FG(object)); displayFG = INV_DISPLAY_FG(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } float get_x_from_freq(float min, float max, float freq, float range) { return 10.0+(range * (log(freq/min) / log(max/min))); } float get_y_from_gain(float gain) { return 8.0 + 12.0*((12.0-gain)/6.0); } float get_fg_freq_from_x(float min, float max, float x, float range) { float r; r=log10(max/min); return min * pow( 10 , r*((x-10)/range) ); } float get_fg_gain_from_y(float y) { return 12.0-(6.0*((y-8.0)/12.0)); } gint check_fg_click_on_control(float freq, float gain, float ex, float ey) { float cx,cy; cx=get_x_from_freq(20.0, 20000.0, freq, 358); cy=get_y_from_gain(gain); if(fabs(cy-ey)<=3 && fabs(cx-ex)<=3) { return 1; } else { return 0; } } void get_fg_value_from_motion(float ex, float ey, float *freq, float *gain) { float Newfreq,Newgain; Newfreq = get_fg_freq_from_x(20.0, 20000.0, ex, 358); Newgain = get_fg_gain_from_y(ey); if(Newfreq< 20.0) Newfreq= 20.0; else if(Newfreq> 20000.0) Newfreq= 20000.0; if(Newgain< 0.0) Newgain= 0.0; else if(Newgain> 12.0) Newgain= 12.0; *freq=Newfreq; *gain=Newgain; } static gboolean inv_display_fg_button_press_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_DISPLAY_FG(widget)); if(check_fg_click_on_control(INV_DISPLAY_FG(widget)->freq,INV_DISPLAY_FG(widget)->gain,event->x,event->y)==1) { g_object_set(G_OBJECT(widget),"has-tooltip",FALSE,NULL); gtk_widget_set_state(widget,GTK_STATE_ACTIVE); gtk_widget_grab_focus(widget); //setup for motion function inv_display_fg_paint(widget,INV_DISPLAYFG_DRAW_DATA); } return TRUE; } static gboolean inv_display_fg_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) { g_assert(INV_IS_DISPLAY_FG(widget)); if((GTK_WIDGET (widget)->state)==GTK_STATE_ACTIVE) { get_fg_value_from_motion(event->x,event->y,&(INV_DISPLAY_FG(widget)->freq),&(INV_DISPLAY_FG(widget)->gain)); inv_display_fg_paint(widget,INV_DISPLAYFG_DRAW_DATA); return FALSE; //let the after signal run } else { return TRUE; } } static gboolean inv_display_fg_button_release_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_DISPLAY_FG(widget)); if((GTK_WIDGET (widget)->state)==GTK_STATE_ACTIVE) { gtk_widget_set_state(widget,GTK_STATE_NORMAL); g_object_set(G_OBJECT(widget),"has-tooltip",TRUE,NULL); inv_display_fg_paint(widget,INV_DISPLAYFG_DRAW_DATA); } return TRUE; } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/switch-toggle-img_on.xpm0000664000175000017500000002267211251515772026567 0ustar alessioalessio/* XPM */ static char * switch_toggle_img_on_xpm[] = { "25 25 515 2", " c None", ". c #CEB49A", "+ c #CCB096", "@ c #C4A88D", "# c #9C7F68", "$ c #D6C1AA", "% c #DDCBB2", "& c #DBC6AE", "* c #C9B398", "= c #82644F", "- c #8B6E57", "; c #8B6B56", "> c #E3D9C5", ", c #D9C6AD", "' c #C5AB91", ") c #B59980", "! c #C2A78C", "~ c #9E836E", "{ c #DDD1BD", "] c #E7DECB", "^ c #E1D2BD", "/ c #CBB59E", "( c #7C604D", "_ c #6D5343", ": c #674E3F", "< c #6D513D", "[ c #775A43", "} c #E7DECA", "| c #D9C9B3", "1 c #C1A78F", "2 c #AD9381", "3 c #C7B3A1", "4 c #CCB29A", "5 c #BAA188", "6 c #C3AE97", "7 c #C6AE93", "8 c #BFA589", "9 c #A1876F", "0 c #856C59", "a c #644E3E", "b c #554030", "c c #574130", "d c #694E3F", "e c #ECE6D6", "f c #DDD0BD", "g c #CEB8A1", "h c #D2C3B8", "i c #DACAB8", "j c #C5AB95", "k c #CBB29A", "l c #C7AD95", "m c #C4A88F", "n c #AE927B", "o c #AF937A", "p c #AC9179", "q c #957964", "r c #866B55", "s c #7A624F", "t c #745E4A", "u c #433126", "v c #473328", "w c #5B4334", "x c #F5F3E9", "y c #DBCEBC", "z c #E6DDCB", "A c #F4EFE9", "B c #DBCBB8", "C c #CCB39C", "D c #C4AA92", "E c #C6AD97", "F c #C9AF98", "G c #C9AE95", "H c #C3A98E", "I c #B29980", "J c #A18970", "K c #927863", "L c #846A56", "M c #816754", "N c #775E4C", "O c #765D4C", "P c #3E2D21", "Q c #59412E", "R c #F9F9F3", "S c #DDD3C2", "T c #DCCCB8", "U c #F3EFE6", "V c #E3D6C2", "W c #E2D5C0", "X c #D3BFAB", "Y c #DDCEB9", "Z c #D4BBA3", "` c #C5AA91", " . c #BBA188", ".. c #A48A73", "+. c #A58B72", "@. c #9C836B", "#. c #967C64", "$. c #8D7460", "%. c #755E4B", "&. c #735C4D", "*. c #3D2B21", "=. c #402D20", "-. c #584030", ";. c #F0EDE2", ">. c #CCB8A3", ",. c #E7DACC", "'. c #DDCEBC", "). c #E1D3BD", "!. c #E1D4C4", "~. c #ECE6D9", "{. c #E1D2BC", "]. c #C8AE95", "^. c #B1967F", "/. c #856D58", "(. c #7C6450", "_. c #765E48", ":. c #7E6450", "<. c #8D735E", "[. c #947A65", "}. c #8E735E", "|. c #866C59", "1. c #725A49", "2. c #6C5644", "3. c #34261E", "4. c #412F23", "5. c #E0D4BF", "6. c #DED1BC", "7. c #CEB7A1", "8. c #E9E1D5", "9. c #D9C5AF", "0. c #DCCDB9", "a. c #EFECE0", "b. c #E6DDCA", "c. c #D6C2AA", "d. c #9A826D", "e. c #7A634E", "f. c #604834", "g. c #86694C", "h. c #7F5F3F", "i. c #6B4D30", "j. c #68513F", "k. c #6E5845", "l. c #7F6654", "m. c #8D735F", "n. c #866B58", "o. c #745B4B", "p. c #705B49", "q. c #46352B", "r. c #3B2A20", "s. c #423025", "t. c #E7E1CD", "u. c #CDB69B", "v. c #CAB6A2", "w. c #D3BFA7", "x. c #D7C3AB", "y. c #DACBB8", "z. c #EAE5D3", "A. c #DAC9B1", "B. c #A29079", "C. c #B0A998", "D. c #A8997E", "E. c #AA9072", "F. c #AE8E6E", "G. c #906E4D", "H. c #64472D", "I. c #6A4929", "J. c #6F5032", "K. c #6F5745", "L. c #816956", "M. c #9B806A", "N. c #826756", "O. c #6E5645", "P. c #5D483A", "Q. c #2D2017", "R. c #35271C", "S. c #D7C7AF", "T. c #AE9277", "U. c #D4BEA6", "V. c #C0A48B", "W. c #C1A890", "X. c #CEB79E", "Y. c #AB967E", "Z. c #ACA289", "`. c #C6C4BC", " + c #E9E2D0", ".+ c #D0B28E", "++ c #BE9873", "@+ c #AE8B6A", "#+ c #97785E", "$+ c #60432A", "%+ c #543A24", "&+ c #654A33", "*+ c #7B6250", "=+ c #9A806C", "-+ c #8E745E", ";+ c #735B47", ">+ c #715949", ",+ c #34251F", "'+ c #33251E", ")+ c #C8B299", "!+ c #9B7E67", "~+ c #CAB39A", "{+ c #BCA188", "]+ c #BDA58E", "^+ c #D4BCA2", "/+ c #BCA288", "(+ c #8D785D", "_+ c #BEB39D", ":+ c #ECDDBE", "<+ c #CEA373", "[+ c #A77E5A", "}+ c #8B6F58", "|+ c #8A694D", "1+ c #A37E5B", "2+ c #946F4F", "3+ c #583C29", "4+ c #4F3520", "5+ c #6F5743", "6+ c #967C67", "7+ c #755E4A", "8+ c #745C4A", "9+ c #513E33", "0+ c #30221C", "a+ c #B1977D", "b+ c #A1846D", "c+ c #AF957D", "d+ c #B39981", "e+ c #AD927B", "f+ c #C2A88F", "g+ c #A78D75", "h+ c #988063", "i+ c #E7D9AE", "j+ c #D7AD75", "k+ c #B18865", "l+ c #967961", "m+ c #846851", "n+ c #77553C", "o+ c #B28866", "p+ c #8B6447", "q+ c #684935", "r+ c #51351F", "s+ c #755C46", "t+ c #876D5B", "u+ c #9F876F", "v+ c #957C68", "w+ c #77604E", "x+ c #594537", "y+ c #271D16", "z+ c #AC9278", "A+ c #907460", "B+ c #A88E77", "C+ c #A18771", "D+ c #A28873", "E+ c #AD9279", "F+ c #907560", "G+ c #AC9172", "H+ c #E6C896", "I+ c #E3BF90", "J+ c #9A795A", "K+ c #8C6F57", "L+ c #93765C", "M+ c #997758", "N+ c #C39B79", "O+ c #AE825E", "P+ c #7B573E", "Q+ c #583B27", "R+ c #896F58", "S+ c #967B66", "T+ c #AF9780", "U+ c #A18770", "V+ c #7A614F", "W+ c #584435", "X+ c #231A13", "Y+ c #9C8068", "Z+ c #806452", "`+ c #AB9079", " @ c #A08670", ".@ c #9F836E", "+@ c #A58B74", "@@ c #8C735D", "#@ c #AC8C6C", "$@ c #E4BF8F", "%@ c #E9CB9F", "&@ c #BF9D7A", "*@ c #AA917D", "=@ c #9D8167", "-@ c #A98C72", ";@ c #C89F78", ">@ c #A38266", ",@ c #533724", "'@ c #A48E79", ")@ c #9E836C", "!@ c #C7AD93", "~@ c #B79E85", "{@ c #846B58", "]@ c #644F3E", "^@ c #281B17", "/@ c #705442", "(@ c #9F856E", "_@ c #8A705E", ":@ c #947A64", "<@ c #9F866E", "[@ c #866E58", "}@ c #A6896F", "|@ c #EED4AD", "1@ c #EDD9BB", "2@ c #EEE0D1", "3@ c #F3EAD9", "4@ c #D5C4AF", "5@ c #8A7362", "6@ c #745C49", "7@ c #442D20", "8@ c #987A61", "9@ c #6A4D38", "0@ c #B3A08E", "a@ c #B39980", "b@ c #D0B69D", "c@ c #B89E86", "d@ c #A18670", "e@ c #523F32", "f@ c #241915", "g@ c #947960", "h@ c #6F5642", "i@ c #8A715D", "j@ c #876B59", "k@ c #8B715D", "l@ c #977D68", "m@ c #8C725D", "n@ c #BAA18A", "o@ c #EEDDC4", "p@ c #FDFBF9", "q@ c #FFFFFF", "r@ c #FAF4E7", "s@ c #DDCCB7", "t@ c #AB8D6F", "u@ c #5C432D", "v@ c #543C2B", "w@ c #60442E", "x@ c #997D6A", "y@ c #D2BBA2", "z@ c #D5BEA6", "A@ c #A98F79", "B@ c #A78B74", "C@ c #2C1F17", "D@ c #1C1512", "E@ c #826752", "F@ c #7B624D", "G@ c #6E5746", "H@ c #8E745D", "I@ c #937762", "J@ c #BFA98D", "K@ c #F1E8E1", "L@ c #FFFFFE", "M@ c #F6ECD9", "N@ c #C4AD95", "O@ c #9C826D", "P@ c #775C40", "Q@ c #4A321F", "R@ c #463022", "S@ c #967E68", "T@ c #DCCCB7", "U@ c #DACAB4", "V@ c #B79C84", "W@ c #866C58", "X@ c #1F1612", "Y@ c #1F1713", "Z@ c #836951", "`@ c #7C634D", " # c #533F30", ".# c #856B58", "+# c #816855", "@# c #846955", "## c #907660", "$# c #C3A888", "%# c #FAF4EC", "&# c #FEFDFB", "*# c #FCF7EB", "=# c #E5D4BD", "-# c #B9A18C", ";# c #957C63", "># c #6E553C", ",# c #63482E", "'# c #442D1D", ")# c #655245", "!# c #E4D9C5", "~# c #C4AC94", "{# c #C0A88F", "]# c #3E2C25", "^# c #191211", "/# c #1B1510", "(# c #795D4C", "_# c #624B3B", ":# c #564234", "<# c #856B57", "[# c #7B6351", "}# c #957A61", "|# c #B59A7F", "1# c #E8D9C9", "2# c #F6ECDF", "3# c #F7EDD9", "4# c #F0E1C6", "5# c #CBB6A0", "6# c #8E7259", "7# c #896F59", "8# c #513B2C", "9# c #341F0F", "0# c #301D10", "a# c #332319", "b# c #C7B19B", "c# c #C4A990", "d# c #796352", "e# c #1C1313", "f# c #140F0D", "g# c #71553E", "h# c #6C5341", "i# c #4D3B2B", "j# c #685244", "k# c #7C6251", "l# c #816854", "m# c #A38972", "n# c #C1A88E", "o# c #D9C4AC", "p# c #DDC4AA", "q# c #D3B796", "r# c #7B624E", "s# c #553F2E", "t# c #5E4837", "u# c #23120A", "v# c #140703", "w# c #1B110E", "x# c #B69B84", "y# c #97806B", "z# c #241814", "A# c #140F0E", "B# c #17110F", "C# c #634A36", "D# c #664F3D", "E# c #453327", "F# c #634C3E", "G# c #755942", "H# c #90755A", "I# c #917862", "J# c #A28974", "K# c #9A806A", "L# c #765E4C", "M# c #785E44", "N# c #624A36", "O# c #472F1C", "P# c #220E06", "Q# c #090302", "R# c #3C332C", "S# c #98806C", "T# c #2F201C", "U# c #160F0F", "V# c #0E0E0D", "W# c #624B36", "X# c #604B39", "Y# c #4C392B", "Z# c #543F33", "`# c #573D2E", " $ c #644C3B", ".$ c #8E765E", "+$ c #997E64", "@$ c #917863", "#$ c #886E58", "$$ c #6E5542", "%$ c #311D0F", "&$ c #1B0C08", "*$ c #060000", "=$ c #372721", "-$ c #291C18", ";$ c #1A1210", ">$ c #181212", ",$ c #5C4433", "'$ c #5D4536", ")$ c #4D3A2C", "!$ c #4A3627", "~$ c #3C2518", "{$ c #4D3626", "]$ c #886F5A", "^$ c #997B5F", "/$ c #8A6E54", "($ c #896C51", "_$ c #664D39", ":$ c #27160C", "<$ c #100604", "[$ c #1E0A08", "}$ c #211714", "|$ c #16100E", "1$ c #16110F", "2$ c #543D30", "3$ c #574234", "4$ c #4B382B", "5$ c #402F24", "6$ c #1C100B", "7$ c #4C3725", "8$ c #83654A", "9$ c #826853", "0$ c #71573F", "a$ c #49301C", "b$ c #0B0401", "c$ c #0E0807", "d$ c #1D1410", "e$ c #15100F", "f$ c #161111", "g$ c #48342A", "h$ c #46342C", "i$ c #402E25", "j$ c #2F201A", "k$ c #3A261B", "l$ c #3E2B21", "m$ c #160F0B", "n$ c #191210", "o$ c #1C1613", "p$ c #1F1815", " . + @ # $ % & * = - ; ", " > , ' ) ! ~ { ] ^ / ( _ : < [ ", " } | 1 2 3 4 5 6 7 7 8 9 0 a b c d ", " e f g h i j k l m n o p q r s t u v w ", " x y z A B C D E F G H I J K L M N O u P Q ", " R S T U V W X Y Z ` .....+.@.#.$.s %.&.*.=.-. ", " ;.>.,.'.).!.~.{.].^./.(._.:.<.<.[.}.|.1.2.3.4. ", "5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.", "t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.", "S.T.U.V.W.W X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+", ")+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+|.6+7+8+9+0+", "a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+", "z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+", "Y+Z+`+ @.@+@@@#@$@%@&@C+*@=@-@;@>@,@'@)@!@~@{@]@^@", "#./@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@", "g@h@i@j@k@l@m@n@o@p@q@q@r@s@t@u@v@w@x@y@z@A@B@C@D@", "E@F@G@H@k@k@I@J@K@q@q@L@M@N@O@P@Q@R@S@T@U@V@W@X@Y@", "Z@`@ #.#+#@###$#%#q@&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#", " (#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f# ", " g#h#i#j#k#l#m#n#o#p#q#r#s#t#b u#v#w#x#y#z#A#B# ", " C#D#E#F#:.G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V# ", " W#X#Y#Z#`# $1..$+$@$#$$$%$&$*$=$-$;$>$ ", " ,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$ ", " 2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$ ", " g$h$i$j$k$l$C@m$n$o$p$ "}; invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-Spectrograph.h0000664000175000017500000000401011251515772026252 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DISPLAY_SPEC_H #define __DISPLAY_SPEC_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_DISPLAY_SPEC_DRAW_ALL 0 #define INV_DISPLAY_SPEC_DRAW_DATA 1 #define INV_DISPLAY_SPEC_DRAW_ONE 2 #define INV_DISPLAY_SPEC(obj) GTK_CHECK_CAST(obj, inv_display_spec_get_type (), InvDisplaySpec) #define INV_DISPLAY_SPEC_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_display_spec_get_type(), InvDisplaySpecClass) #define INV_IS_DISPLAY_SPEC(obj) GTK_CHECK_TYPE(obj, inv_display_spec_get_type()) typedef struct _InvDisplaySpec InvDisplaySpec; typedef struct _InvDisplaySpecClass InvDisplaySpecClass; struct _InvDisplaySpec { GtkWidget widget; gint bypass; float value[31]; gint lastvalue[31]; char label[31][6]; struct colour mOff60,mOff12,mOff6,mOff0,overOff; struct colour mOn60, mOn12, mOn6, mOn0, overOn; /* delta */ gint font_size; }; struct _InvDisplaySpecClass { GtkWidgetClass parent_class; }; GtkType inv_display_spec_get_type(void); GtkWidget * inv_display_spec_new(); void inv_display_spec_set_bypass(InvDisplaySpec *display_spec, gint num); void inv_display_spec_set_value(InvDisplaySpec *display_spec, gint pos, float num); void inv_display_spec_draw_now(InvDisplaySpec *display_spec, gint mode); G_END_DECLS #endif /* __DISPLAY_SPEC_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-phase.c0000664000175000017500000002701711251515772024367 0ustar alessioalessio/* This widget provides phase meters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "string.h" #include "widgets.h" #include "meter-phase.h" static void inv_phase_meter_class_init(InvPhaseMeterClass *klass); static void inv_phase_meter_init(InvPhaseMeter *meter); static void inv_phase_meter_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_phase_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_phase_meter_realize(GtkWidget *widget); static gboolean inv_phase_meter_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_phase_meter_paint(GtkWidget *widget, gint mode); static void inv_phase_meter_destroy(GtkObject *object); static void inv_phase_meter_colour(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led); GtkType inv_phase_meter_get_type(void) { static GType inv_phase_meter_type = 0; char *name; int i; if (!inv_phase_meter_type) { static const GTypeInfo type_info = { sizeof(InvPhaseMeterClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_phase_meter_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvPhaseMeter), 0, /* n_preallocs */ (GInstanceInitFunc)inv_phase_meter_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvPhaseMeter-%p-%d",inv_phase_meter_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_phase_meter_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_phase_meter_type; } void inv_phase_meter_set_bypass(InvPhaseMeter *meter, gint num) { if(meter->bypass != num) { meter->bypass = num; meter->phase=0; } } void inv_phase_meter_set_phase(InvPhaseMeter *meter, float num) { meter->phase = num; if(GTK_WIDGET_REALIZED(meter)) inv_phase_meter_paint(GTK_WIDGET(meter),INV_PHASE_METER_DRAW_DATA); } GtkWidget * inv_phase_meter_new() { return GTK_WIDGET(gtk_type_new(inv_phase_meter_get_type())); } static void inv_phase_meter_class_init(InvPhaseMeterClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_phase_meter_realize; widget_class->size_request = inv_phase_meter_size_request; widget_class->size_allocate = inv_phase_meter_size_allocate; widget_class->expose_event = inv_phase_meter_expose; object_class->destroy = inv_phase_meter_destroy; } static void inv_phase_meter_init(InvPhaseMeter *meter) { meter->bypass = INV_PLUGIN_ACTIVE; meter->phase = 0; meter->mOff0.R =0.1; meter->mOff0.G =0.1; meter->mOff0.B =0.4; meter->mOn0.R =-0.1; meter->mOn0.G =-0.1; meter->mOn0.B =0.6; meter->mOff30.R =0.2; meter->mOff30.G =0.3; meter->mOff30.B =0.4; meter->mOn30.R =-0.1; meter->mOn30.G =0.3; meter->mOn30.B =0.6; meter->mOff45.R =0.2; meter->mOff45.G =0.4; meter->mOff45.B =0.2; meter->mOn45.R =0.1; meter->mOn45.G =0.6; meter->mOn45.B =-0.1; meter->mOff60.R =0.5; meter->mOff60.G =0.5; meter->mOff60.B =0.0; meter->mOn60.R =0.5; meter->mOn60.G =0.5; meter->mOn60.B =0.0; meter->mOff90.R=0.4; meter->mOff90.G=0.2; meter->mOff90.B=0.0; meter->mOn90.R =0.6; meter->mOn90.G =0.0; meter->mOn90.B =0.0; meter->font_size=0; gtk_widget_set_tooltip_markup(GTK_WIDGET(meter),"Phase Meter."); } static void inv_phase_meter_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_PHASE_METER(widget)); g_return_if_fail(requisition != NULL); requisition->width = 388; requisition->height = 36; } static void inv_phase_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_PHASE_METER(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_phase_meter_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_PHASE_METER(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 388; attributes.height = 36; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_phase_meter_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_PHASE_METER(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_phase_meter_paint(widget,INV_PHASE_METER_DRAW_ALL); return FALSE; } static void inv_phase_meter_paint(GtkWidget *widget, gint mode) { gint phase; gint bypass; gint i; cairo_t *cr; float Pon; GtkStyle *style; char label[10]; struct colour led; cairo_text_extents_t extents; style = gtk_widget_get_style(widget); bypass = INV_PHASE_METER(widget)->bypass; phase = (gint)((INV_PHASE_METER(widget)->phase*57.295779506)+0.2); cr = gdk_cairo_create(widget->window); if(INV_PHASE_METER(widget)->font_size==0) { INV_PHASE_METER(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } if(mode==INV_PHASE_METER_DRAW_ALL) { cairo_set_source_rgb(cr, 0, 0, 0); cairo_paint(cr); cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 35); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 387, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 35); cairo_line_to(cr, 387, 35); cairo_line_to(cr, 387, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } cairo_rectangle(cr, 14, 21, 1, 2); cairo_fill(cr); cairo_rectangle(cr, 104, 21, 1, 2); cairo_fill(cr); cairo_rectangle(cr, 194, 21, 1, 2); cairo_fill(cr); cairo_rectangle(cr, 284, 21, 1, 2); cairo_fill(cr); cairo_rectangle(cr, 374, 21, 1, 2); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); } else { cairo_set_source_rgb(cr, 1, 1, 1); } cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_PHASE_METER(widget)->font_size); strcpy(label,"-90"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,13-(extents.width/2),31); cairo_show_text(cr,label); strcpy(label,"-45"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,103-(extents.width/2),31); cairo_show_text(cr,label); strcpy(label,"0"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,194-(extents.width/2),31); cairo_show_text(cr,label); strcpy(label,"45"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,284-(extents.width/2),31); cairo_show_text(cr,label); strcpy(label,"90"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,374-(extents.width/2),31); cairo_show_text(cr,label); } inv_phase_meter_colour(widget, bypass, 0, 1, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 194, 5, 1, 14); for ( i = 1; i <= 90; i++) { Pon = i <= phase ? 1 : 0; inv_phase_meter_colour(widget, bypass, i, Pon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 194+(i*2), 5, 1, 14); cairo_fill(cr); cairo_rectangle(cr, 194-(i*2), 5, 1, 14); cairo_fill(cr); } cairo_destroy(cr); } static void inv_phase_meter_destroy(GtkObject *object) { InvPhaseMeter *meter; InvPhaseMeterClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_PHASE_METER(object)); meter = INV_PHASE_METER(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static void inv_phase_meter_colour(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led) { float r1,r2; struct colour mOff0 = INV_PHASE_METER(widget)->mOff0; struct colour mOn0 = INV_PHASE_METER(widget)->mOn0; struct colour mOff30 = INV_PHASE_METER(widget)->mOff30; struct colour mOn30 = INV_PHASE_METER(widget)->mOn30; struct colour mOff45 = INV_PHASE_METER(widget)->mOff45; struct colour mOn45 = INV_PHASE_METER(widget)->mOn45; struct colour mOff60 = INV_PHASE_METER(widget)->mOff60; struct colour mOn60 = INV_PHASE_METER(widget)->mOn60; struct colour mOff90 = INV_PHASE_METER(widget)->mOff90; struct colour mOn90 = INV_PHASE_METER(widget)->mOn90; if(pos < 30) { r1=(30.0-(float)pos)/30.0; r2=(float)pos/30.0; led->R=(r1 * mOff0.R + (r2 * mOff30.R)) + (on * ((r1 * mOn0.R) + (r2 * mOn30.R))) ; led->G=(r1 * mOff0.G + (r2 * mOff30.G)) + (on * ((r1 * mOn0.G) + (r2 * mOn30.G))) ; led->B=(r1 * mOff0.B + (r2 * mOff30.B)) + (on * ((r1 * mOn0.B) + (r2 * mOn30.B))) ; } else if (pos < 45) { r1=(45.0-(float)pos)/15.0; r2=((float)pos-30.0)/15.0; led->R=(r1 * mOff30.R + (r2 * mOff45.R)) + (on * ((r1 * mOn30.R) + (r2 * mOn45.R))) ; led->G=(r1 * mOff30.G + (r2 * mOff45.G)) + (on * ((r1 * mOn30.G) + (r2 * mOn45.G))) ; led->B=(r1 * mOff30.B + (r2 * mOff45.B)) + (on * ((r1 * mOn30.B) + (r2 * mOn45.B))) ; } else if (pos < 60) { r1=(60.0-(float)pos)/15.0; r2=((float)pos-45.0)/15.0; led->R=(r1 * mOff45.R + (r2 * mOff60.R)) + (on * ((r1 * mOn45.R) + (r2 * mOn60.R))) ; led->G=(r1 * mOff45.G + (r2 * mOff60.G)) + (on * ((r1 * mOn45.G) + (r2 * mOn60.G))) ; led->B=(r1 * mOff45.B + (r2 * mOff60.B)) + (on * ((r1 * mOn45.B) + (r2 * mOn60.B))) ; } else { r1=(90.0-(float)pos)/30.0; r2=((float)pos-60.0)/30.0; led->R=(r1 * mOff60.R + (r2 * mOff90.R)) + (on * ((r1 * mOn60.R) + (r2 * mOn90.R))) ; led->G=(r1 * mOff60.G + (r2 * mOff90.G)) + (on * ((r1 * mOn60.G) + (r2 * mOn90.G))) ; led->B=(r1 * mOff60.B + (r2 * mOff90.B)) + (on * ((r1 * mOn60.B) + (r2 * mOn90.B))) ; } if(bypass==INV_PLUGIN_BYPASS) { led->R=(led->R+led->G+led->B)/3; led->G=led->R; led->B=led->R; } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/knob-img_medium.xpm0000664000175000017500000002771711251515772025611 0ustar alessioalessio/* XPM */ static char * knob_img_medium_xpm[] = { "46 46 485 2", " c None", ". c #AEA59D", "+ c #ABA29A", "@ c #AEA59C", "# c #A59D95", "$ c #9F968E", "% c #ADA49C", "& c #A89E96", "* c #A19890", "= c #9D958D", "- c #9A9189", "; c #9E958C", "> c #7F7771", ", c #6F6762", "' c #C7BFB7", ") c #BDB4AC", "! c #B6ADA5", "~ c #AAA198", "{ c #A19991", "] c #999089", "^ c #9D948C", "/ c #A39B92", "( c #A89F97", "_ c #A59C93", ": c #A39A92", "< c #A49B93", "[ c #A29A91", "} c #9E968E", "| c #A0978F", "1 c #9C948B", "2 c #938A83", "3 c #8C847E", "4 c #756C67", "5 c #D4CCC2", "6 c #BFB7AF", "7 c #B5ACA3", "8 c #AFA69E", "9 c #A9A097", "0 c #989088", "a c #A69E95", "b c #A9A098", "c c #A79E94", "d c #A59D94", "e c #A49B92", "f c #9D948A", "g c #A79E96", "h c #8D857D", "i c #837B74", "j c #918881", "k c #716862", "l c #CBC2BA", "m c #C6BEB6", "n c #A59C94", "o c #A49C93", "p c #ABA299", "q c #ACA39B", "r c #AAA199", "s c #A29991", "t c #9E968D", "u c #A0968E", "v c #9C938A", "w c #9F968D", "x c #948B83", "y c #968E86", "z c #968C84", "A c #8F877F", "B c #8C847D", "C c #DCD5CD", "D c #C9C0B7", "E c #BBB2AA", "F c #A8A098", "G c #A69D96", "H c #AFA69D", "I c #9C948C", "J c #A0988F", "K c #A79F95", "L c #989087", "M c #978F86", "N c #9C938B", "O c #9B928A", "P c #9D958C", "Q c #958C84", "R c #9D948D", "S c #A39A91", "T c #887F77", "U c #6B635E", "V c #EBE9E4", "W c #C7BFB6", "X c #B4ABA3", "Y c #ABA39A", "Z c #9F978F", "` c #AAA19A", " . c #B1A9A0", ".. c #AEA69D", "+. c #ACA49B", "@. c #A39B93", "#. c #A49C94", "$. c #A09890", "%. c #9E958D", "&. c #A29990", "*. c #999087", "=. c #968D86", "-. c #888078", ";. c #7F7871", ">. c #C6BFB6", ",. c #C0B9B0", "'. c #A29992", "). c #A69E96", "!. c #B7AEA6", "~. c #B3ABA2", "{. c #ACA49C", "]. c #ABA39B", "^. c #A8A097", "/. c #A89F96", "(. c #9F978E", "_. c #9D948B", ":. c #A79E95", "<. c #9E958B", "[. c #968D85", "}. c #908780", "|. c #928982", "1. c #938A82", "2. c #DFDBD5", "3. c #AAA29A", "4. c #B5ACA4", "5. c #A59C95", "6. c #A79F97", "7. c #A69D95", "8. c #A29A92", "9. c #999088", "0. c #978E86", "a. c #928A82", "b. c #7B736E", "c. c #E7E6E0", "d. c #BFB8B0", "e. c #AEA69E", "f. c #B0A7A0", "g. c #BAB1A9", "h. c #BBB2A9", "i. c #BFB6AD", "j. c #B0A79F", "k. c #ADA59D", "l. c #9B938A", "m. c #988F86", "n. c #988F87", "o. c #5A534E", "p. c #C4BCB4", "q. c #B7AFA7", "r. c #BEB5AD", "s. c #BEB6AE", "t. c #C1B8B0", "u. c #ADA39B", "v. c #B0A89F", "w. c #A0978E", "x. c #948C83", "y. c #857D76", "z. c #DCD7D2", "A. c #C6BEB5", "B. c #C4BBB3", "C. c #BFB6AE", "D. c #C0B7AF", "E. c #BFB6AF", "F. c #B9B0A7", "G. c #B3AAA2", "H. c #B1A9A1", "I. c #B6ADA6", "J. c #B1A8A0", "K. c #AAA197", "L. c #9A9188", "M. c #999189", "N. c #8E857E", "O. c #8E867F", "P. c #8F867F", "Q. c #DFDAD5", "R. c #CEC7BF", "S. c #CAC1B9", "T. c #C2B9B0", "U. c #C7BDB5", "V. c #BDB3AB", "W. c #B8AFA6", "X. c #B7AEA5", "Y. c #BCB3AB", "Z. c #AAA299", "`. c #A69D94", " + c #B1A89F", ".+ c #9B9289", "++ c #978D85", "@+ c #928981", "#+ c #968E85", "$+ c #91887F", "%+ c #938A81", "&+ c #D4CDC4", "*+ c #C6BDB5", "=+ c #C5BCB4", "-+ c #BDB4AB", ";+ c #BAB2A9", ">+ c #BBB3AB", ",+ c #BAB1A8", "'+ c #B4ABA2", ")+ c #AEA49C", "!+ c #AFA79E", "~+ c #A89F95", "{+ c #978E85", "]+ c #8C837C", "^+ c #E5E3DB", "/+ c #CBC3BA", "(+ c #C2B9B1", "_+ c #B8AFA7", ":+ c #B2A99F", "<+ c #B5ADA5", "[+ c #B2A9A1", "}+ c #B0A79E", "|+ c #ADA49B", "1+ c #ABA199", "2+ c #A2988F", "3+ c #968D84", "4+ c #958D85", "5+ c #958C83", "6+ c #8D847D", "7+ c #766F69", "8+ c #CFC8BE", "9+ c #C7BEB5", "0+ c #BDB5AC", "a+ c #C3BAB1", "b+ c #BEB4AC", "c+ c #BAB2AA", "d+ c #B2A9A0", "e+ c #A79D95", "f+ c #ADA39A", "g+ c #ACA39A", "h+ c #A19990", "i+ c #A0968D", "j+ c #938B82", "k+ c #877E77", "l+ c #C4BBB2", "m+ c #C0B7AE", "n+ c #B6ADA4", "o+ c #B7AFA6", "p+ c #ADA49A", "q+ c #A1988F", "r+ c #9B9189", "s+ c #877E76", "t+ c #878078", "u+ c #CEC5BE", "v+ c #C1B9B1", "w+ c #C8BFB6", "x+ c #B0A8A0", "y+ c #B7AEA7", "z+ c #B8AFA5", "A+ c #B5ACA2", "B+ c #BCB3AA", "C+ c #AFA69C", "D+ c #A2998F", "E+ c #918980", "F+ c #8E857D", "G+ c #8A817A", "H+ c #6F6660", "I+ c #DBD4CD", "J+ c #CCC3BB", "K+ c #C7BEB6", "L+ c #B7ADA6", "M+ c #BCB3AC", "N+ c #B9B0A8", "O+ c #B3AAA1", "P+ c #B2A8A0", "Q+ c #9B9288", "R+ c #847B75", "S+ c #CCC4BB", "T+ c #BBB1A9", "U+ c #BFB7AE", "V+ c #B4ACA3", "W+ c #B1A7A0", "X+ c #948B82", "Y+ c #867E76", "Z+ c #817972", "`+ c #B8AEA6", " @ c #AFA59D", ".@ c #A69D93", "+@ c #A1978E", "@@ c #867D76", "#@ c #8A827A", "$@ c #CDC4BC", "%@ c #B9B1A8", "&@ c #ABA298", "*@ c #8C837B", "=@ c #877E75", "-@ c #D2C9C0", ";@ c #CBC3BB", ">@ c #CEC5BD", ",@ c #CAC2B9", "'@ c #B6ACA3", ")@ c #B0A69E", "!@ c #A9A096", "~@ c #918880", "{@ c #857D75", "]@ c #D5CDC4", "^@ c #D1C8C0", "/@ c #C2B8AF", "(@ c #B4ABA4", "_@ c #B3A9A1", ":@ c #B7ADA5", "<@ c #ABA29B", "[@ c #9F958C", "}@ c #948B84", "|@ c #D8D2C9", "1@ c #C9C1B8", "2@ c #C1B8AF", "3@ c #B5ADA4", "4@ c #ACA39C", "5@ c #B5ABA3", "6@ c #9E958E", "7@ c #D1C9C1", "8@ c #C6BDB4", "9@ c #BEB5AC", "0@ c #AFA69F", "a@ c #A49A91", "b@ c #9A9187", "c@ c #8F877E", "d@ c #8D847C", "e@ c #807871", "f@ c #D3CBC3", "g@ c #C9C1B9", "h@ c #C3BAB2", "i@ c #C9C0B8", "j@ c #CCC3BA", "k@ c #B9AFA7", "l@ c #B8AEA5", "m@ c #BAB0A7", "n@ c #8F867E", "o@ c #877F77", "p@ c #766D67", "q@ c #CEC6BD", "r@ c #BCB4AB", "s@ c #B6AFB0", "t@ c #B0AAB4", "u@ c #AFA59C", "v@ c #908880", "w@ c #C0B8AF", "x@ c #8887B3", "y@ c #162AED", "z@ c #273AF1", "A@ c #B5AEB0", "B@ c #BCB2A9", "C@ c #B1A79F", "D@ c #B4ABA1", "E@ c #A99F96", "F@ c #A59C92", "G@ c #958D84", "H@ c #D6CFC6", "I@ c #C3BBB2", "J@ c #C5BCB3", "K@ c #B8B0A8", "L@ c #AEA9B6", "M@ c #3845D6", "N@ c #011BFE", "O@ c #001AFF", "P@ c #7C80CF", "Q@ c #BBB1A8", "R@ c #B1A89E", "S@ c #ACA299", "T@ c #AAA097", "U@ c #A49A92", "V@ c #A69C93", "W@ c #9B938B", "X@ c #A0978D", "Y@ c #675F59", "Z@ c #C8C0B8", "`@ c #C5BDB4", " # c #BEB5B1", ".# c #686DC3", "+# c #071FF7", "@# c #0C23F5", "## c #777BC8", "$# c #BFB7B0", "%# c #B6AEA5", "&# c #BFB5AC", "*# c #B1A79E", "=# c #AAA098", "-# c #777068", ";# c #CFC7BF", "># c #9693B0", ",# c #1429EE", "'# c #3A48DF", ")# c #B3AAA0", "!# c #A09790", "~# c #9E948B", "{# c #8B837B", "]# c #D6CFC7", "^# c #CCC4BC", "/# c #C8C0B7", "(# c #B5AEAF", "_# c #535BC9", ":# c #031CFA", "<# c #172CF0", "[# c #8688C8", "}# c #C5BBB3", "|# c #A89F98", "1# c #B0A69D", "2# c #B2A89F", "3# c #A39A90", "4# c #A1978F", "5# c #9A9289", "6# c #7E766F", "7# c #D9D4CB", "8# c #7F80BE", "9# c #1429EF", "0# c #021CFC", "a# c #4F5BDA", "b# c #B9B1B2", "c# c #8E867D", "d# c #9B99B8", "e# c #3241DB", "f# c #2738E6", "g# c #A7A3BA", "h# c #CAC2BA", "i# c #B9AFA6", "j# c #B6ADA3", "k# c #A79D94", "l# c #78706A", "m# c #1D2DD1", "n# c #021BFB", "o# c #0820F9", "p# c #7277D0", "q# c #C9C0BA", "r# c #CDC5BC", "s# c #CAC1B8", "t# c #57514C", "u# c #0C21E9", "v# c #4756EE", "w# c #C1BDCB", "x# c #C4BCB3", "y# c #6B635C", "z# c #CDC6BF", "A# c #CDC4BB", "B# c #B7AEA4", "C# c #ACA49A", "D# c #A59B92", "E# c #ABA399", "F# c #7D756E", "G# c #DAD5CF", "H# c #D1C9C0", "I# c #CFC8BF", "J# c #C8BFB7", "K# c #CDC5BD", "L# c #BEB4AB", "M# c #C5BBB2", "N# c #B7ADA4", "O# c #5A534F", "P# c #D7D1C8", "Q# c #D2C9C1", "R# c #CBC2B9", "S# c #C1B9B0", "T# c #887F78", "U# c #D0C7BE", "V# c #CFC7BE", "W# c #B6ACA4", "X# c #AEA59B", "Y# c #534C48", "Z# c #DFDAD2", "`# c #CEC6BE", " $ c #CFC6BD", ".$ c #BAB0A8", "+$ c #B3A9A0", "@$ c #A69C94", "#$ c #8B827B", "$$ c #403A33", "%$ c #DCD6CF", "&$ c #D0C8BF", "*$ c #B0A79D", "=$ c #423C3A", "-$ c #B4AAA1", ";$ c #6A635D", ">$ c #BEB7B0", ",$ c #C3B9B1", "'$ c #BFB5AD", ")$ c #968E87", "!$ c #716963", "~$ c #37302B", "{$ c #665F5A", "]$ c #423B36", "^$ c #A49C96", "/$ c #AFA79F", "($ c #A19891", "_$ c #918982", ":$ c #766F6A", " . + @ # $ $ % & * = - ; > , ", " ' ) ! ~ ~ { ] ^ / ( _ : < [ } | 1 2 3 4 ", " 5 6 7 8 9 * 0 | a b c d e ; f } g 9 - 1 h i j k ", " l m + % n : = o b p q r s t u a ( v w - x j y z A B ", " C D E % + F : G r + H b } I | J K $ L M N O - P Q R S L T U ", " V W X Y Z n ` ...+.8 d < @.#.d $.%.N &.&.&.* *.O : ; O ^ =.-.;. ", " >.,.H | '.).!.~.8 % F {.].r + ^.: * './.(._.P $ s e :.<.* [.}.|.1.i ", " 2.W @ / 3.! 4.X ! r 5.% ).6.( | (.t 7.7.8.&.N - &.&.d J | 9.0.N 9.9.a.b. ", " c.d.e.f.g.h.i.h.j.< k.8 * | #.8.N 8.g s : s | n < S | ( t - t l.m.n.a.n.1.o. ", " p.q.X r.s.t.h.u.v.^.< n r s Z [ / 6.S e S ~ ( < e # @.w a t _.w.n.9.9.[.x.y. ", " z.A.B.C.D.E.F.G.H.I.{.J.K.o $.n ^.b o * 3.8 @.&.n e %.&.< N d ; L.P M.N.O.P.9.}. ", " Q.R.S.T.U.V.W.X.!.Y.F.j.Y Z.~ ( /.`.| F +( + [ u.%.* g s &.S .+[ ; ++@+[.#+w.v $+%+ ", " &+l *+=+-+E ;+>+,+'+~.G.'+ +J.)+| # !+6.9 _ + /.$ ~+( : _ w.&.&.%.0.0 %.%.9.[.x {+]+ ", " ^+/+(+E i.r.C.) _+:+<+J.k.[+H . H H ~ }+|+% ( &.7.r :.1+/./.< ^ 9.* S 2+3+{+3+4+1.5+6+7+ ", " 8+9+0+D.a+b+(+E c+g.g.9 r J.8 '+7 d+q + p e++ j.f+g+@ p p a _.| :.n h+i+- 0.0.j+^ [.1.k+ ", " l t.t._+l+*+s.m+! f.e.+ . H.!.}+n+ +~ g+% +o+ .}+|+p+}+q+r+| _.* : v x 3+*.0.m._.v s+t+ ", "u+l v+t.w+*+(+(+-+4.% x+k.y+! '+z+A+q p G.h.B+F.J.H C+:.* %.w q+J S m.O D+*.E+*.* [.F+1.G+H+", "I+J+K+*+w+9+i.g.X L+M+!.N+_+4.n+@ g O+P+_+X.@ p +~ e &.w : : /.: - e ; L L.w.- Q+#+n.L.m.R+", "S+W B.D 9+T.4.) T+U+v+!.M+V++.r W+O+n+O+d+r H.@ g b e e `.Z./.* < e w %.L.w f $ w.w.*.X+Y+Z+", "S.*+l B.t.m+t.r.(+i.X.N+|+a d+! }+I.`+ @[+N+`.n @8 +p 1+:.< @ &.< [ < w .@( /.+@^ 5+@@#@s+", "$@$@J+K+9+B.) i.) %@W.H |+i.4.J.4.q g+r.. `.H 8 d+X p &@9 r |+e : ( 7.< 9 /.S v v m.x x *@=@", "-@;@>@,@D.) z+B+h...j.V+g.!.H '@8 4.4.)@q % E X.G.}+r 9 9 : :.~ !@% b S `.q+N ; $ _.~@1.h {@", "]@^@>@B./@X.i.n+~.-+Y.g.(@n+j.V+X . u.8 j.'+_@:@_+O+X 9 r j.'+g+<@&.^._.[.O _.[@_.3+}@Q x k+", "|@^@1@i.T.2@Y.(+B.6 ! G.3@W.E 4@@ +d+! 5@. X +G.X.p 8 7 g+1+/./.o 6@L v &._.w.l.I M ~@@+@@", "7@>@l+8@2@9@v+(+h.G.I.O+<+. 8 0@_+) h.J.[+8 O+n+7 X n+ +'+`.S @ S * $ : &._ a@_.b@c@5+.+d@e@", "f@g@h@i@j@D t.E N+!.Y.! F.! k@C.i.! !.j.X l@ @7 F.m@)@|+n b r 5.$ w $ S /.&.$ - L._.v n@o@p@", "q@J+i@S.S.a+D.r@a+9@%@!._+s@t@C.g.N+ +m@ + +m+i.5@u@@ ..% g e w &.a 6.e s n.O n w n.x A n@v@", "^@q@$@h@l+h@D.w+w@0@j.s.x@y@z@A@h.E I.'+k@T.B@[+C@D@A+E@S q+w._ < w.F@w - w q+; [.^ {+G@[.{@", "H@g@*+I@0+(+J@4.e.K@L@M@N@O@O@P@2@! X.a+Y.'+! Q@,+R@S@/.!@T@b U@~ V@_.W@X@O {+{+_.^ q+9.n@Y@", "Z@,@`@i@C.(+ .h. #.#+#O@O@@###$#%#m+2@W.g.7 @*#:. +*#@ 9 =#p * ^ S O ^ &.P %.S S 9.x #@-#", " ;#i@2@B.N+i.>#,#O@O@O@'#L@4.) l+) r.4.n+i.2@W. +'+n+u@}+)#7.!#* ~#_.| S S n `._ s _.0.{# ", " ]#^#l /#(#_#:#O@O@<#[#w@B+}#B.9@t._+-+! |# +-+X.7 p 1#2#b 7.S X@3#`.(.#.K.c 4#q+5#x 3+6# ", " 7#,@S.8#9#O@O@0#a#b#t.=+8@l+l+m+i.C.G.. O+A+,+*#@ +8 r :.e w._ < s + /.9 V@m.M.1 w c# ", " d#e#O@O@O@f#g#h#1@l m 9+9+D.9@r.n+)@i#_+j#q }+j.8 )++ e < k#: /.~+:.+ %.^ | w.w.6+l# ", " m#n#O@o#p#q#i@r#s#/#i@(+U+T.r.E Y.h.X.8 p @ }+H !@p /.9 b p |+g+|+r w %.:.F@O v@#@t# ", " u#v#w#,@S.,@S.r#*+9+i@x#m+D.D.C.N+H O+H 4.@ &@|+}+H |+'+J.d+. e ( `.c &.[.X+X+y# ", " z#^#s#^#A.*+S.j@A#t.N+i.i.T+d+_+W.W.7 '+H R@B# +)#H C#*#p / D#E#q w._.w l.F# ", " G#H#I#J#Z@K#A#8@Y.L#M#2@_+X Y.Y.B+4.N#'+:@!.;+!.p +C@r r ~ 9 :.7.e * w.k+O# ", " P#Q#R#D l S+8@S#w+8@W.t.9@m+N+B+_+,+!.h.g.O+ +}+@ . b d+9 e+^._ c D#T#t# ", " U#V#$@h#J#s#A#l+B.*+J@h.g.W#F.!.>+m+'+G.7 J.+ r +.|+9 < /./.X#`.~@Y# ", " Z#`#S. $J#(+(+J@J#t..$B+W.h.D.Y.'+g.+$ + @@ p s _ _ 1+H K.@$#$$$ ", " %$&$B.(+J#B.l+2@) B+a+) ,+n+) !.O+4.*#@ 9 H b ~ *$u@F@w.e@=$ ", " ,@J#B.a+m+B+T.D.w@E 9@T+`+W.n+j.H |+*#|+-$|+u@.@F+;$ ", " >$M#t.,$w+=+x#D.D.E '$) ,+|++. +q O+'+g+& )$!$~$ ", " w+C.(+h@(+C.a+W.N+. < j.g+. n+H s 2 {$]$ ", " ^$e.r./$p /.* r = $.($_$;$:$ "}; invada-studio-plugins-lv2-1.2.0/plugingui/widgets/widgets.h0000664000175000017500000000246511251515772023630 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INV_WIDGETS_H #define __INV_WIDGETS_H #include #include #define INV_PLUGIN_ACTIVE 0 #define INV_PLUGIN_BYPASS 1 #define INV_PI 3.1415926535 struct point2D { float x; float y; }; struct point3D { float x; float y; float z; }; struct colour { float R; float G; float B; }; gint inv_choose_light_dark(GdkColor *bg,GdkColor *light,GdkColor *dark); gint inv_choose_font_size(cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight, double width, double height, const char *character); #endif /* __INV_WIDGETS_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-Compressor.c0000664000175000017500000005023011251515772025745 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "display-Compressor.h" static void inv_display_comp_class_init(InvDisplayCompClass *klass); static void inv_display_comp_init(InvDisplayComp *displayComp); static void inv_display_comp_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_display_comp_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_display_comp_realize(GtkWidget *widget); static gboolean inv_display_comp_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_display_comp_paint(GtkWidget *widget, gint mode); static void inv_display_comp_destroy(GtkObject *object); float inv_display_comp_rms_waveform(float pos, float width, float height); GtkType inv_display_comp_get_type(void) { static GtkType inv_display_comp_type = 0; char *name; int i; if (!inv_display_comp_type) { static const GTypeInfo type_info = { sizeof(InvDisplayCompClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_display_comp_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvDisplayComp), 0, /* n_preallocs */ (GInstanceInitFunc)inv_display_comp_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvDisplayComp-%p-%d",inv_display_comp_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_display_comp_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_display_comp_type; } void inv_display_comp_set_bypass(InvDisplayComp *displayComp, gint num) { displayComp->bypass = num; } void inv_display_comp_set_rms(InvDisplayComp *displayComp, float num) { if(num<0) displayComp->rms = 0; else if (num <= 1) displayComp->rms = num; else displayComp->rms = 1; if(displayComp->rms != displayComp->Lastrms) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } void inv_display_comp_set_attack(InvDisplayComp *displayComp, float num) { if(num<0.00001) displayComp->attack = 0.00001; else if (num <= 0.750) displayComp->attack = num; else displayComp->attack = 0.750; if(displayComp->attack != displayComp->Lastattack) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } void inv_display_comp_set_release(InvDisplayComp *displayComp, float num) { if(num<0.001) displayComp->release = 0.001; else if (num <= 5.0) displayComp->release = num; else displayComp->release = 5.0; if(displayComp->release != displayComp->Lastrelease) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } void inv_display_comp_set_threshold(InvDisplayComp *displayComp, float num) { if(num<-36.0) displayComp->threshold = -36.0; else if (num <= 0.0) displayComp->threshold = num; else displayComp->threshold = 0.0; if(displayComp->threshold != displayComp->Lastthreshold) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } void inv_display_comp_set_ratio(InvDisplayComp *displayComp, float num) { if(num<1.0) displayComp->ratio = 1.0; else if (num <= 20.0) displayComp->ratio = num; else displayComp->ratio = 20.0; if(displayComp->ratio != displayComp->Lastratio) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } void inv_display_comp_set_gain(InvDisplayComp *displayComp, float num) { if(num<-6.0) displayComp->gain = -6.0; else if (num <= 36.0) displayComp->gain = num; else displayComp->gain = 36.0; if(displayComp->gain != displayComp->Lastgain) { if(GTK_WIDGET_REALIZED(displayComp)) inv_display_comp_paint(GTK_WIDGET(displayComp),INV_DISPLAYCOMP_DRAW_DATA); } } GtkWidget * inv_display_comp_new() { return GTK_WIDGET(gtk_type_new(inv_display_comp_get_type())); } static void inv_display_comp_class_init(InvDisplayCompClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_display_comp_realize; widget_class->size_request = inv_display_comp_size_request; widget_class->size_allocate = inv_display_comp_size_allocate; widget_class->expose_event = inv_display_comp_expose; object_class->destroy = inv_display_comp_destroy; } static void inv_display_comp_init(InvDisplayComp *displayComp) { gint i; displayComp->bypass=INV_PLUGIN_ACTIVE; displayComp->rms=0.5; displayComp->attack=0.00001; displayComp->release=0.001; displayComp->threshold=0.0; displayComp->ratio=1.0; displayComp->gain=0.0; displayComp->Lastrms=displayComp->rms; displayComp->Lastattack=displayComp->attack; displayComp->Lastrelease=displayComp->release; displayComp->Lastthreshold=displayComp->threshold; displayComp->Lastratio=displayComp->ratio; displayComp->Lastgain=displayComp->gain; displayComp->SIGmax=0.0; for (i=0;i<292;i++) { displayComp->SIG[i]=inv_display_comp_rms_waveform((float) i, 292, 104); displayComp->SIGmax= fabs(displayComp->SIG[i]) > displayComp->SIGmax ? displayComp->SIG[i] : displayComp->SIGmax; } displayComp->header_font_size=0; displayComp->label_font_size=0; displayComp->info_font_size=0; gtk_widget_set_tooltip_markup(GTK_WIDGET(displayComp),"Detector and Envelope: This shows how the RMS, Attack and Release interact to produce an envelope.\nCompressor: This shows how the Threshold, Ratio and Gain affect the audio at different levels."); } static void inv_display_comp_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_COMP(widget)); g_return_if_fail(requisition != NULL); requisition->width = 600; requisition->height = 234; } static void inv_display_comp_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_COMP(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_display_comp_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_COMP(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 600; attributes.height = 234; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_display_comp_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_DISPLAY_COMP(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_display_comp_paint(widget,INV_DISPLAYCOMP_DRAW_ALL); return FALSE; } static void inv_display_comp_paint(GtkWidget *widget, gint mode) { gint bypass; float rms; float attack; float release; float threshold; float ratio; float gain; gint i; float rmsC,rmsV,attackC,releaseC,env; float y,threshsig; cairo_t *cr; GtkStyle *style; char label[50]; style = gtk_widget_get_style(widget); bypass=INV_DISPLAY_COMP(widget)->bypass; rms=INV_DISPLAY_COMP(widget)->rms; attack=INV_DISPLAY_COMP(widget)->attack; release=INV_DISPLAY_COMP(widget)->release; threshold=INV_DISPLAY_COMP(widget)->threshold; ratio=INV_DISPLAY_COMP(widget)->ratio; gain=INV_DISPLAY_COMP(widget)->gain; cr = gdk_cairo_create(widget->window); if(INV_DISPLAY_COMP(widget)->header_font_size==0) { INV_DISPLAY_COMP(widget)->header_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,8.1,"0"); } if(INV_DISPLAY_COMP(widget)->label_font_size==0) { INV_DISPLAY_COMP(widget)->label_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,7.1,"0"); } if(INV_DISPLAY_COMP(widget)->info_font_size==0) { INV_DISPLAY_COMP(widget)->info_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } if(mode==INV_DISPLAYCOMP_DRAW_ALL) { cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); for(i=0;i<2;i++) { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, (i*300), 233); cairo_line_to(cr, (i*300), 0); cairo_line_to(cr, (i*300)+299, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, (i*300), 233); cairo_line_to(cr, (i*300)+299, 233); cairo_line_to(cr, (i*300)+299, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, (i*300)+1, 1, 298, 232 ); cairo_fill(cr); } /* detector labels */ cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } cairo_set_font_size(cr,INV_DISPLAY_COMP(widget)->header_font_size); sprintf(label,"Detector And Envelope"); cairo_move_to(cr,75,13); cairo_show_text(cr,label); cairo_set_font_size(cr,INV_DISPLAY_COMP(widget)->label_font_size); sprintf(label,"Audio"); cairo_move_to(cr,35,230); cairo_show_text(cr,label); sprintf(label,"Detected Signal"); cairo_move_to(cr,105,230); cairo_show_text(cr,label); sprintf(label,"Envelope"); cairo_move_to(cr,225,230); cairo_show_text(cr,label); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.4); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.4); } cairo_set_line_width(cr,1.0); cairo_move_to(cr, 25, 230); cairo_line_to(cr, 31, 222); cairo_stroke(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.25); } else { cairo_set_source_rgba(cr, 1.0, 0.1, 0.0, 0.25); } cairo_rectangle(cr, 95, 222, 6, 6 ); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.0, 0.1, 1.0); } cairo_rectangle(cr, 215, 222, 6, 6 ); cairo_fill(cr); /* compressor labels */ cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } cairo_set_font_size(cr,INV_DISPLAY_COMP(widget)->header_font_size); sprintf(label,"Compressor"); cairo_move_to(cr,415,13); cairo_show_text(cr,label); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); } else { cairo_set_source_rgb(cr, 1, 1, 1); } cairo_rectangle(cr, 566, 17, 1, 191); cairo_fill(cr); cairo_rectangle(cr, 306, 207, 260, 1); cairo_fill(cr); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_DISPLAY_COMP(widget)->info_font_size); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } for(i=0;i<8;i+=2) { sprintf(label,"%3idB",-(i*6)); cairo_move_to(cr,569,42+(i*21)); cairo_show_text(cr,label); sprintf(label,"%idB",-(i*6)); switch(i) { case 0: cairo_move_to(cr,530-(i*30),219); break; case 2: case 4: case 6: cairo_move_to(cr,525-(i*30),219); break; } cairo_show_text(cr,label); } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } cairo_set_font_size(cr,INV_DISPLAY_COMP(widget)->label_font_size); sprintf(label,"Original"); cairo_move_to(cr,385,230); cairo_show_text(cr,label); sprintf(label,"Compressed"); cairo_move_to(cr,465,230); cairo_show_text(cr,label); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.4); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.4); } cairo_set_line_width(cr,1.0); cairo_move_to(cr, 375, 230); cairo_line_to(cr, 381, 222); cairo_stroke(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.0, 0.1, 1); } cairo_set_line_width(cr,2.0); cairo_move_to(cr, 455, 230); cairo_line_to(cr, 461, 222); cairo_stroke(cr); } /* rms display */ if(mode == INV_DISPLAYCOMP_DRAW_ALL || rms != INV_DISPLAY_COMP(widget)->Lastrms || attack != INV_DISPLAY_COMP(widget)->Lastattack || release != INV_DISPLAY_COMP(widget)->Lastrelease ) { if(mode == INV_DISPLAYCOMP_DRAW_ALL || rms != INV_DISPLAY_COMP(widget)->Lastrms ) { //compute new rms if needed rmsC= (pow(rms,3) * 400)+1; rmsV=0; attackC= 1 - pow(10, -301.0301 / (attack*1000000.0)); releaseC= 1 - pow(10, -301.0301 / (release*1000000.0)); env=0; for (i=0;i<292;i++) { y=INV_DISPLAY_COMP(widget)->SIG[i]; rmsV = sqrt(( (rmsC-1)*rmsV*rmsV + y*y ) / rmsC); INV_DISPLAY_COMP(widget)->RMS[i]=rmsV; env += (INV_DISPLAY_COMP(widget)->RMS[i] > env) ? attackC * (INV_DISPLAY_COMP(widget)->RMS[i] - env) : releaseC * (INV_DISPLAY_COMP(widget)->RMS[i] - env) ; INV_DISPLAY_COMP(widget)->ENV[i]=env; } } else if(attack != INV_DISPLAY_COMP(widget)->Lastattack || release != INV_DISPLAY_COMP(widget)->Lastrelease ) { //compute new evelope if needed attackC= 1 - pow(10, -301.0301 / (attack*1000000.0)); releaseC= 1 - pow(10, -301.0301 / (release*1000000.0)); env=0; for (i=0;i<292;i++) { env += (INV_DISPLAY_COMP(widget)->RMS[i] > env) ? attackC * (INV_DISPLAY_COMP(widget)->RMS[i] - env) : releaseC * (INV_DISPLAY_COMP(widget)->RMS[i] - env) ; INV_DISPLAY_COMP(widget)->ENV[i]=env; } } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 3, 15, 294, 206 ); cairo_fill(cr); //draw envelope if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.0, 0.1, 1); } cairo_set_line_width(cr,1.0); cairo_move_to(cr, 4, 117); for (i=0;i<292;i++) { cairo_line_to(cr, 4+i, 117-INV_DISPLAY_COMP(widget)->ENV[i]); } cairo_line_to(cr, 295, 117); cairo_line_to(cr, 4, 117); cairo_fill(cr); // draw axis if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } else { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } cairo_rectangle(cr, 4, 117, 292, 1 ); cairo_fill(cr); //draw rms if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.25); } else { cairo_set_source_rgba(cr, 1.0, 0.1, 0.0, 0.25); } cairo_set_line_width(cr,1.0); cairo_move_to(cr, 4, 117); for (i=0;i<292;i++) { cairo_line_to(cr, 4+i, 117-INV_DISPLAY_COMP(widget)->RMS[i]); } cairo_line_to(cr, 295, 117); cairo_line_to(cr, 4, 117); cairo_fill(cr); //draw original signal if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.25); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.25); } cairo_set_line_width(cr,1.0); cairo_move_to(cr, 4, 117); for (i=0;i<292;i++) { cairo_line_to(cr, 4+i, 117-INV_DISPLAY_COMP(widget)->SIG[i]); } cairo_stroke(cr); } /* compressor display */ if(mode == INV_DISPLAYCOMP_DRAW_ALL || threshold != INV_DISPLAY_COMP(widget)->Lastthreshold || ratio != INV_DISPLAY_COMP(widget)->Lastratio || gain != INV_DISPLAY_COMP(widget)->Lastgain ) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 306, 17, 260, 190 ); cairo_fill(cr); for(i=1;i<8;i+=2) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.15, 0.15, 0.15); } else { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } cairo_rectangle(cr, 296+(i*30), 17, 1, 190); cairo_fill(cr); cairo_rectangle(cr, 306, 38+(i*21), 260, 1); cairo_fill(cr); } for(i=0;i<5;i+=2) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } else { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } cairo_rectangle(cr, 356+(i*30), 17, 1, 190); cairo_fill(cr); cairo_rectangle(cr, 306, 80+(i*21), 260, 1); cairo_fill(cr); } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } cairo_rectangle(cr, 536, 17, 1, 190); cairo_fill(cr); cairo_rectangle(cr, 306, 38, 260, 1); cairo_fill(cr); cairo_rectangle(cr, 306, 17, 260, 190 ); cairo_clip(cr); /* compressed signal */ // gain change at +6 db <- GRAPH MUST END HERE threshsig=pow(10,threshold/20); y = 20*log10(threshsig+((2-threshsig)/ratio)); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.0, 0.1, 1); } cairo_set_line_width(cr,2); cairo_move_to(cr, 306 , 200-(21*gain/6)); cairo_line_to(cr, 536+(30*threshold/6), 38-(21*gain/6)-(21*threshold/6)); cairo_line_to(cr, 566 , 38-(21*gain/6)-(21*y/6)); cairo_stroke(cr); /* original signal */ cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.25); cairo_set_line_width(cr,1.0); cairo_move_to(cr, 306, 200); cairo_line_to(cr, 566, 17); cairo_stroke(cr); } cairo_destroy(cr); INV_DISPLAY_COMP(widget)->Lastrms=rms; INV_DISPLAY_COMP(widget)->Lastattack=attack; INV_DISPLAY_COMP(widget)->Lastrelease=release; INV_DISPLAY_COMP(widget)->Lastthreshold=threshold; INV_DISPLAY_COMP(widget)->Lastratio=ratio; INV_DISPLAY_COMP(widget)->Lastgain=gain; } static void inv_display_comp_destroy(GtkObject *object) { InvDisplayComp *displayComp; InvDisplayCompClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_DISPLAY_COMP(object)); displayComp = INV_DISPLAY_COMP(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } float inv_display_comp_rms_waveform(float pos, float width, float height) { float theta,theta2; float heightr,heightr2; float value; value=0; if(pos < width/3) { theta=2*INV_PI*(13.5*pow(3*pos/width,0.5)); heightr=1-(pow(3*pos/width,0.1)); value+=3*height*heightr*sin(theta); } if(pos > width/3) { theta=2*INV_PI*(8* 3* (pos-width/3) / (2*width) ); theta2=2*INV_PI*(32* 3* (pos-width/3) / (2*width) ); heightr=1-(pow(3*(pos-width/3)/(2*width),12)); heightr2=1-(pow(3*(pos-width/3)/(2*width),0.5)); value+=0.6*height*heightr*sin(theta) + 0.2*height*heightr2*sin(theta2); } return value; } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/knob.h0000664000175000017500000000561611251515772023114 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __KNOB_H #define __KNOB_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_KNOB_DRAW_ALL 0 #define INV_KNOB_DRAW_DATA 1 #define INV_KNOB_SIZE_SMALL 50 #define INV_KNOB_SIZE_MEDIUM 64 #define INV_KNOB_SIZE_LARGE 80 #define INV_KNOB_CURVE_LINEAR 0 #define INV_KNOB_CURVE_LOG 1 #define INV_KNOB_CURVE_QUAD 2 #define INV_KNOB_MARKINGS_PAN 0 #define INV_KNOB_MARKINGS_CUST10 1 #define INV_KNOB_MARKINGS_CUST12 2 #define INV_KNOB_MARKINGS_3 3 #define INV_KNOB_MARKINGS_4 4 #define INV_KNOB_MARKINGS_5 5 #define INV_KNOB_MARKINGS_10 10 #define INV_KNOB_HIGHLIGHT_L -1 #define INV_KNOB_HIGHLIGHT_C 0 #define INV_KNOB_HIGHLIGHT_R 1 #define INV_KNOB(obj) GTK_CHECK_CAST(obj, inv_knob_get_type (), InvKnob) #define INV_KNOB_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_knob_get_type(), InvKnobClass) #define INV_IS_KNOB(obj) GTK_CHECK_TYPE(obj, inv_knob_get_type()) typedef struct _InvKnob InvKnob; typedef struct _InvKnobClass InvKnobClass; struct _InvKnob { GtkWidget widget; gint bypass; gint size; gint curve; gint markings; gint highlight; gint human; char units[5]; char clow[10]; char cmid[10]; char chigh[10]; float min; float max; float value; float lastvalue; float click_x; float click_y; GdkPixbuf *img_small; GdkPixbuf *img_med; GdkPixbuf *img_large; gint font_size; }; struct _InvKnobClass { GtkWidgetClass parent_class; }; GtkType inv_knob_get_type(void); GtkWidget * inv_knob_new(); void inv_knob_set_bypass(InvKnob *knob, gint num); void inv_knob_set_size(InvKnob *knob, gint num); void inv_knob_set_curve(InvKnob *knob, gint num); void inv_knob_set_markings(InvKnob *knob, gint num); void inv_knob_set_custom(InvKnob *knob, gint pos, char *label); void inv_knob_set_highlight(InvKnob *knob, gint num); void inv_knob_set_human(InvKnob *knob); void inv_knob_set_units(InvKnob *knob, char *units); void inv_knob_set_min(InvKnob *knob, float num); void inv_knob_set_max(InvKnob *knob, float num); void inv_knob_set_value(InvKnob *knob, float num); void inv_knob_set_tooltip(InvKnob *knob, gchar *tip); float inv_knob_get_value(InvKnob *knob); G_END_DECLS #endif /* __KNOB_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-peak.c0000664000175000017500000006547311251515772024217 0ustar alessioalessio/* This widget provides peak meters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "string.h" #include "widgets.h" #include "meter-peak.h" static void inv_meter_class_init(InvMeterClass *klass); static void inv_meter_init(InvMeter *meter); static void inv_meter_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_meter_realize(GtkWidget *widget); static gboolean inv_meter_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_meter_paint(GtkWidget *widget, gint drawmode); static void inv_meter_destroy(GtkObject *object); static void inv_meter_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led); static void inv_meter_colour_fromzero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led); static void inv_meter_colour_bigtozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led); GtkType inv_meter_get_type(void) { static GType inv_meter_type = 0; char *name; int i; if (!inv_meter_type) { static const GTypeInfo type_info = { sizeof(InvMeterClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_meter_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvMeter), 0, /* n_preallocs */ (GInstanceInitFunc)inv_meter_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvMeter-%p-%d",inv_meter_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_meter_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_meter_type; } void inv_meter_set_bypass(InvMeter *meter, gint num) { if(meter->bypass != num) { meter->bypass = num; switch(meter->mode) { case INV_METER_DRAW_MODE_TOZERO: meter->LdB=-90; meter->RdB=-90; break; case INV_METER_DRAW_MODE_FROMZERO: meter->LdB=0; meter->RdB=0; break; } } } void inv_meter_set_channels(InvMeter *meter, gint num) { meter->channels = num; } void inv_meter_set_mode(InvMeter *meter, gint num) { meter->mode = num; } void inv_meter_set_LdB(InvMeter *meter, float num) { meter->LdB = num; if(GTK_WIDGET_REALIZED(meter)) inv_meter_paint(GTK_WIDGET(meter),INV_METER_DRAW_L); } void inv_meter_set_RdB(InvMeter *meter, float num) { meter->RdB = num; if(GTK_WIDGET_REALIZED(meter)) inv_meter_paint(GTK_WIDGET(meter),INV_METER_DRAW_R); } GtkWidget * inv_meter_new() { return GTK_WIDGET(gtk_type_new(inv_meter_get_type())); } static void inv_meter_class_init(InvMeterClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_meter_realize; widget_class->size_request = inv_meter_size_request; widget_class->size_allocate = inv_meter_size_allocate; widget_class->expose_event = inv_meter_expose; object_class->destroy = inv_meter_destroy; } static void inv_meter_init(InvMeter *meter) { meter->bypass = INV_PLUGIN_ACTIVE; meter->mode=INV_METER_DRAW_MODE_TOZERO; meter->channels = 1; meter->LdB = -90; meter->RdB = -90; meter->lastLpos = 1; meter->lastRpos = 1; meter->mOff60.R =0.1; meter->mOff60.G =0.1; meter->mOff60.B =0.4; meter->mOn60.R =-0.1; meter->mOn60.G =-0.1; meter->mOn60.B =0.6; meter->mOff12.R =0.2; meter->mOff12.G =0.3; meter->mOff12.B =0.4; meter->mOn12.R =-0.1; meter->mOn12.G =0.3; meter->mOn12.B =0.6; meter->mOff6.R =0.2; meter->mOff6.G =0.4; meter->mOff6.B =0.2; meter->mOn6.R =0.1; meter->mOn6.G =0.6; meter->mOn6.B =-0.1; meter->mOff0.R =0.5; meter->mOff0.G =0.5; meter->mOff0.B =0.0; meter->mOn0.R =0.5; meter->mOn0.G =0.5; meter->mOn0.B =0.0; meter->overOff.R=0.4; meter->overOff.G=0.2; meter->overOff.B=0.0; meter->overOn.R =0.6; meter->overOn.G =0.0; meter->overOn.B =0.0; meter->label_font_size=0; meter->scale_font_size=0; gtk_widget_set_tooltip_markup(GTK_WIDGET(meter),"Peak Meter."); } static void inv_meter_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_METER(widget)); g_return_if_fail(requisition != NULL); switch(INV_METER(widget)->mode) { case INV_METER_DRAW_MODE_TOZERO: case INV_METER_DRAW_MODE_FROMZERO: requisition->width = 149; requisition->height = 37; break; case INV_METER_DRAW_MODE_BIGTOZERO: requisition->width = 308; requisition->height = 37; break; } } static void inv_meter_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_METER(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_meter_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_METER(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; switch(INV_METER(widget)->mode) { case INV_METER_DRAW_MODE_TOZERO: case INV_METER_DRAW_MODE_FROMZERO: attributes.width = 149; attributes.height = 37; break; case INV_METER_DRAW_MODE_BIGTOZERO: attributes.width = 308; attributes.height = 37; break; } attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_meter_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_METER(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_meter_paint(widget,INV_METER_DRAW_ALL); return FALSE; } static void inv_meter_paint(GtkWidget *widget, gint drawmode) { gint bypass; gint mode; gint channels; gint Lpos=0; gint Rpos=0; gint lastLpos; gint lastRpos; cairo_t *cr; gint Lon,Ron,min,max,i; struct colour led; GtkStyle *style; char label[10]; cairo_text_extents_t extents; style = gtk_widget_get_style(widget); bypass = INV_METER(widget)->bypass; mode = INV_METER(widget)->mode; channels = INV_METER(widget)->channels; switch(mode) { case INV_METER_DRAW_MODE_TOZERO: Lpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_METER(widget)->LdB+60.51) : 0 ; /* -60 to +6 db step 1db = 67 points*/ Rpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_METER(widget)->RdB+60.51) : 0 ; break; case INV_METER_DRAW_MODE_FROMZERO: Lpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(2*(INV_METER(widget)->LdB)+71.51): 72 ; /* -35.5 to 0 db step 0.5db = 71 points */ Rpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(2*(INV_METER(widget)->RdB)+71.51): 72 ; break; case INV_METER_DRAW_MODE_BIGTOZERO: Lpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(2*(INV_METER(widget)->LdB)+120.51) : 0 ; /* -60 to +12 db step 0.5db = 145 points*/ Rpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(2*(INV_METER(widget)->RdB)+120.51) : 0 ; break; } lastLpos = INV_METER(widget)->lastLpos; lastRpos = INV_METER(widget)->lastRpos; cr = gdk_cairo_create(widget->window); if(INV_METER(widget)->label_font_size==0) { INV_METER(widget)->label_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } if(INV_METER(widget)->scale_font_size==0) { INV_METER(widget)->scale_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } switch(drawmode) { case INV_METER_DRAW_ALL: gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]); cairo_paint(cr); switch(mode) { case INV_METER_DRAW_MODE_TOZERO: case INV_METER_DRAW_MODE_FROMZERO: cairo_set_source_rgb(cr, 0, 0, 0); cairo_rectangle(cr, 0, 0, 149, 24); cairo_fill(cr); cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 23); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 148, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 23); cairo_line_to(cr, 148, 23); cairo_line_to(cr, 148, 0); cairo_stroke(cr); break; case INV_METER_DRAW_MODE_BIGTOZERO: cairo_set_source_rgb(cr, 0, 0, 0); cairo_rectangle(cr, 0, 0, 303, 24); cairo_fill(cr); cairo_new_path(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 23); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 302, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, 23); cairo_line_to(cr, 302, 23); cairo_line_to(cr, 302, 0); cairo_stroke(cr); break; } cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_METER(widget)->scale_font_size); switch(mode) { case INV_METER_DRAW_MODE_TOZERO: for(i=0;i<=5;i++) { if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_rectangle(cr, 10+(i*24), 25, 1, 2); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } sprintf(label,"%i",(12*i)-60); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,10+(i*24)-(extents.width/2),35); cairo_show_text(cr,label); } break; case INV_METER_DRAW_MODE_FROMZERO: for(i=0;i<=5;i++) { if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_rectangle(cr, 24+(i*24), 25, 1, 2); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } sprintf(label,"%i",30-(6*i)); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,24+(i*24)-(extents.width/2),35); cairo_show_text(cr,label); } break; case INV_METER_DRAW_MODE_BIGTOZERO: for(i=0;i<=12;i++) { if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_rectangle(cr, 10+(i*24), 25, 1, 2); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]); } else { gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); } if(i>10) { sprintf(label,"+%i",(6*i)-60); } else { sprintf(label,"%i",(6*i)-60); } cairo_text_extents (cr,label,&extents); cairo_move_to(cr,10+(i*24)-(extents.width/2),35); cairo_show_text(cr,label); } break; } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.6, 0.6, 0.6); } else { cairo_set_source_rgb(cr, 1, 1, 1); } cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_METER(widget)->label_font_size); switch(mode) { case INV_METER_DRAW_MODE_TOZERO: switch(channels) { case 1: cairo_move_to(cr,3,15); cairo_show_text(cr,"M"); break; case 2: cairo_move_to(cr,3,10); cairo_show_text(cr,"L"); cairo_move_to(cr,3,20); cairo_show_text(cr,"R"); break; } for ( i = 1; i <= 67; i++) { switch(channels) { case 1: Lon = i <= Lpos ? 1 : 0; inv_meter_colour_tozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 3, 1, 18); cairo_fill(cr); break; case 2: Lon = i <= Lpos ? 1 : 0; Ron = i <= Rpos ? 1 : 0; inv_meter_colour_tozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 3, 1, 8); cairo_fill(cr); inv_meter_colour_tozero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 13, 1, 8); cairo_fill(cr); break; } } break; case INV_METER_DRAW_MODE_FROMZERO: for ( i = 1; i <= 71; i++) { switch(channels) { case 1: Lon = i > Lpos ? 1 : 0; inv_meter_colour_fromzero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 2+(i*2), 3, 1, 18); cairo_fill(cr); break; case 2: Lon = i > Lpos ? 1 : 0; Ron = i > Rpos ? 1 : 0; inv_meter_colour_fromzero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 2+(i*2), 3, 1, 8); cairo_fill(cr); inv_meter_colour_fromzero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 2+(i*2), 13, 1, 8); cairo_fill(cr); break; } } break; case INV_METER_DRAW_MODE_BIGTOZERO: switch(channels) { case 1: cairo_move_to(cr,3,15); cairo_show_text(cr,"M"); break; case 2: cairo_move_to(cr,3,10); cairo_show_text(cr,"L"); cairo_move_to(cr,3,20); cairo_show_text(cr,"R"); break; } for ( i = 1; i <= 144; i++) { switch(channels) { case 1: Lon = i <= Lpos ? 1 : 0; inv_meter_colour_bigtozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 3, 1, 18); cairo_fill(cr); break; case 2: Lon = i <= Lpos ? 1 : 0; Ron = i <= Rpos ? 1 : 0; inv_meter_colour_bigtozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 3, 1, 8); cairo_fill(cr); inv_meter_colour_bigtozero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 13, 1, 8); cairo_fill(cr); break; } } break; } INV_METER(widget)->lastLpos = Lpos; INV_METER(widget)->lastRpos = Rpos; break; case INV_METER_DRAW_L: switch(mode) { case INV_METER_DRAW_MODE_TOZERO: min = lastLpos < Lpos ? lastLpos : Lpos; max = lastLpos > Lpos ? lastLpos : Lpos; if(min<1) min=1; if(max<1) max=1; if(min>67) min=67; if(max>67) max=67; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Lon = i <= Lpos ? 1 : 0; inv_meter_colour_tozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); switch(channels) { case 1: cairo_rectangle(cr, 10+(i*2), 3, 1, 18); break; case 2: cairo_rectangle(cr, 10+(i*2), 3, 1, 8); break; } cairo_fill(cr); } } break; case INV_METER_DRAW_MODE_FROMZERO: min = lastLpos < Lpos ? lastLpos : Lpos; max = lastLpos > Lpos ? lastLpos : Lpos; if(min<1) min=1; if(max<1) max=1; if(min>71) min=71; if(max>71) max=71; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Lon = i > Lpos ? 1 : 0; inv_meter_colour_fromzero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); switch(channels) { case 1: cairo_rectangle(cr, 2+(i*2), 3, 1, 18); break; case 2: cairo_rectangle(cr, 2+(i*2), 3, 1, 8); break; } cairo_fill(cr); } } break; case INV_METER_DRAW_MODE_BIGTOZERO: min = lastLpos < Lpos ? lastLpos : Lpos; max = lastLpos > Lpos ? lastLpos : Lpos; if(min<1) min=1; if(max<1) max=1; if(min>144) min=144; if(max>144) max=144; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Lon = i <= Lpos ? 1 : 0; inv_meter_colour_bigtozero(widget, bypass, i, Lon, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); switch(channels) { case 1: cairo_rectangle(cr, 10+(i*2), 3, 1, 18); break; case 2: cairo_rectangle(cr, 10+(i*2), 3, 1, 8); break; } cairo_fill(cr); } } break; } INV_METER(widget)->lastLpos = Lpos; break; case INV_METER_DRAW_R: switch(mode) { case INV_METER_DRAW_MODE_TOZERO: min = lastRpos < Rpos ? lastRpos : Rpos; max = lastRpos > Rpos ? lastRpos : Rpos; if(min<1) min=1; if(max<1) max=1; if(min>67) min=67; if(max>67) max=67; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Ron = i <= Rpos ? 1 : 0; inv_meter_colour_tozero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 13, 1, 8); cairo_fill(cr); } } break; case INV_METER_DRAW_MODE_FROMZERO: min = lastRpos < Rpos ? lastRpos : Rpos; max = lastRpos > Rpos ? lastRpos : Rpos; if(min<1) min=1; if(max<1) max=1; if(min>71) min=71; if(max>71) max=71; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Ron = i > Rpos ? 1 : 0; inv_meter_colour_fromzero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 2+(i*2), 13, 1, 8); cairo_fill(cr); } } break; case INV_METER_DRAW_MODE_BIGTOZERO: min = lastRpos < Rpos ? lastRpos : Rpos; max = lastRpos > Rpos ? lastRpos : Rpos; if(min<1) min=1; if(max<1) max=1; if(min>144) min=144; if(max>144) max=144; if(min != max || max == 1 ) { for ( i = min ; i <= max; i++) { Ron = i <= Rpos ? 1 : 0; inv_meter_colour_bigtozero(widget, bypass, i, Ron, &led); cairo_set_source_rgb(cr, led.R, led.G, led.B); cairo_rectangle(cr, 10+(i*2), 13, 1, 8); cairo_fill(cr); } } break; } INV_METER(widget)->lastRpos = Rpos; break; } cairo_destroy(cr); } static void inv_meter_destroy(GtkObject *object) { InvMeter *meter; InvMeterClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_METER(object)); meter = INV_METER(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static void inv_meter_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led) { float r1,r2; struct colour mOff60 = INV_METER(widget)->mOff60; struct colour mOn60 = INV_METER(widget)->mOn60; struct colour mOff12 = INV_METER(widget)->mOff12; struct colour mOn12 = INV_METER(widget)->mOn12; struct colour mOff6 = INV_METER(widget)->mOff6; struct colour mOn6 = INV_METER(widget)->mOn6; struct colour mOff0 = INV_METER(widget)->mOff0; struct colour mOn0 = INV_METER(widget)->mOn0; struct colour overOff = INV_METER(widget)->overOff; struct colour overOn = INV_METER(widget)->overOn; /* 66 = +6dB 60 = 0dB 51 = -9dB 42 = -18dB */ if(pos < 42) { r1=(42.0-(float)pos)/42.0; r2=(float)pos/42.0; led->R=(r1 * mOff60.R + (r2 * mOff12.R)) + (on * ((r1 * mOn60.R) + (r2 * mOn12.R))) ; led->G=(r1 * mOff60.G + (r2 * mOff12.G)) + (on * ((r1 * mOn60.G) + (r2 * mOn12.G))) ; led->B=(r1 * mOff60.B + (r2 * mOff12.B)) + (on * ((r1 * mOn60.B) + (r2 * mOn12.B))) ; } else if (pos < 51) { r1=(51.0-(float)pos)/9.0; r2=((float)pos-42.0)/9.0; led->R=(r1 * mOff12.R + (r2 * mOff6.R)) + (on * ((r1 * mOn12.R) + (r2 * mOn6.R))) ; led->G=(r1 * mOff12.G + (r2 * mOff6.G)) + (on * ((r1 * mOn12.G) + (r2 * mOn6.G))) ; led->B=(r1 * mOff12.B + (r2 * mOff6.B)) + (on * ((r1 * mOn12.B) + (r2 * mOn6.B))) ; } else if (pos < 60) { r1=(60.0-(float)pos)/9.0; r2=((float)pos-51.0)/9.0; led->R=(r1 * mOff6.R + (r2 * mOff0.R)) + (on * ((r1 * mOn6.R) + (r2 * mOn0.R))) ; led->G=(r1 * mOff6.G + (r2 * mOff0.G)) + (on * ((r1 * mOn6.G) + (r2 * mOn0.G))) ; led->B=(r1 * mOff6.B + (r2 * mOff0.B)) + (on * ((r1 * mOn6.B) + (r2 * mOn0.B))) ; } else { led->R=overOff.R + (on * overOn.R) ; led->G=overOff.G + (on * overOn.G) ; led->B=overOff.B + (on * overOn.B) ; } if(bypass==INV_PLUGIN_BYPASS) { led->R=(led->R+led->G+led->B)/3; led->G=led->R; led->B=led->R; } } static void inv_meter_colour_fromzero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led) { float r1,r2; struct colour mOff60 = INV_METER(widget)->mOff60; struct colour mOn60 = INV_METER(widget)->mOn60; struct colour mOff12 = INV_METER(widget)->mOff12; struct colour mOn12 = INV_METER(widget)->mOn12; struct colour mOff6 = INV_METER(widget)->mOff6; struct colour mOn6 = INV_METER(widget)->mOn6; struct colour mOff0 = INV_METER(widget)->mOff0; struct colour mOn0 = INV_METER(widget)->mOn0; struct colour overOff = INV_METER(widget)->overOff; struct colour overOn = INV_METER(widget)->overOn; /* 72 = 0dB 60 = -6dB 48 = -12dB 24 = -18dB */ if(pos < 24) { r1=(24.0-(float)pos)/24.0; r2=(float)pos/24.0; led->R=(r1 * overOff.R + (r2 * mOff0.R)) + (on * ((r1 * overOn.R) + (r2 * mOn0.R))) ; led->G=(r1 * overOff.G + (r2 * mOff0.G)) + (on * ((r1 * overOn.G) + (r2 * mOn0.G))) ; led->B=(r1 * overOff.B + (r2 * mOff0.B)) + (on * ((r1 * overOn.B) + (r2 * mOn0.B))) ; } else if (pos < 48) { r1=(48.0-(float)pos)/24.0; r2=((float)pos-24.0)/24.0; led->R=(r1 * mOff0.R + (r2 * mOff6.R)) + (on * ((r1 * mOn0.R) + (r2 * mOn6.R))) ; led->G=(r1 * mOff0.G + (r2 * mOff6.G)) + (on * ((r1 * mOn0.G) + (r2 * mOn6.G))) ; led->B=(r1 * mOff0.B + (r2 * mOff6.B)) + (on * ((r1 * mOn0.B) + (r2 * mOn6.B))) ; } else if (pos < 60) { r1=(60.0-(float)pos)/12.0; r2=((float)pos-48.0)/12.0; led->R=(r1 * mOff6.R + (r2 * mOff12.R)) + (on * ((r1 * mOn6.R) + (r2 * mOn12.R))) ; led->G=(r1 * mOff6.G + (r2 * mOff12.G)) + (on * ((r1 * mOn6.G) + (r2 * mOn12.G))) ; led->B=(r1 * mOff6.B + (r2 * mOff12.B)) + (on * ((r1 * mOn6.B) + (r2 * mOn12.B))) ; } else if (pos < 72) { r1=(72.0-(float)pos)/12.0; r2=((float)pos-60.0)/12.0; led->R=(r1 * mOff12.R + (r2 * mOff60.R)) + (on * ((r1 * mOn12.R) + (r2 * mOn60.R))) ; led->G=(r1 * mOff12.G + (r2 * mOff60.G)) + (on * ((r1 * mOn12.G) + (r2 * mOn60.G))) ; led->B=(r1 * mOff12.B + (r2 * mOff60.B)) + (on * ((r1 * mOn12.B) + (r2 * mOn60.B))) ; } else { led->R=mOff60.R + (on * mOn60.R) ; led->G=mOff60.G + (on * mOn60.G) ; led->B=mOff60.B + (on * mOn60.B) ; } if(bypass==INV_PLUGIN_BYPASS) { led->R=(led->R+led->G+led->B)/3; led->G=led->R; led->B=led->R; } } static void inv_meter_colour_bigtozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led) { float r1,r2; struct colour mOff60 = INV_METER(widget)->mOff60; struct colour mOn60 = INV_METER(widget)->mOn60; struct colour mOff12 = INV_METER(widget)->mOff12; struct colour mOn12 = INV_METER(widget)->mOn12; struct colour mOff6 = INV_METER(widget)->mOff6; struct colour mOn6 = INV_METER(widget)->mOn6; struct colour mOff0 = INV_METER(widget)->mOff0; struct colour mOn0 = INV_METER(widget)->mOn0; struct colour overOff = INV_METER(widget)->overOff; struct colour overOn = INV_METER(widget)->overOn; /* 144 = +12dB 120 = 0dB 102 = -9dB 84 = -18dB */ if(pos < 84) { r1=(84.0-(float)pos)/84.0; r2=(float)pos/84.0; led->R=(r1 * mOff60.R + (r2 * mOff12.R)) + (on * ((r1 * mOn60.R) + (r2 * mOn12.R))) ; led->G=(r1 * mOff60.G + (r2 * mOff12.G)) + (on * ((r1 * mOn60.G) + (r2 * mOn12.G))) ; led->B=(r1 * mOff60.B + (r2 * mOff12.B)) + (on * ((r1 * mOn60.B) + (r2 * mOn12.B))) ; } else if (pos < 102) { r1=(102.0-(float)pos)/18.0; r2=((float)pos-84.0)/18.0; led->R=(r1 * mOff12.R + (r2 * mOff6.R)) + (on * ((r1 * mOn12.R) + (r2 * mOn6.R))) ; led->G=(r1 * mOff12.G + (r2 * mOff6.G)) + (on * ((r1 * mOn12.G) + (r2 * mOn6.G))) ; led->B=(r1 * mOff12.B + (r2 * mOff6.B)) + (on * ((r1 * mOn12.B) + (r2 * mOn6.B))) ; } else if (pos < 120) { r1=(120.0-(float)pos)/18.0; r2=((float)pos-102.0)/18.0; led->R=(r1 * mOff6.R + (r2 * mOff0.R)) + (on * ((r1 * mOn6.R) + (r2 * mOn0.R))) ; led->G=(r1 * mOff6.G + (r2 * mOff0.G)) + (on * ((r1 * mOn6.G) + (r2 * mOn0.G))) ; led->B=(r1 * mOff6.B + (r2 * mOff0.B)) + (on * ((r1 * mOn6.B) + (r2 * mOn0.B))) ; } else { led->R=overOff.R + (on * overOn.R) ; led->G=overOff.G + (on * overOn.G) ; led->B=overOff.B + (on * overOn.B) ; } if(bypass==INV_PLUGIN_BYPASS) { led->R=(led->R+led->G+led->B)/3; led->G=led->R; led->B=led->R; } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-peak.h0000664000175000017500000000407411251515772024212 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __METER_H #define __METER_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_METER_DRAW_ALL 0 #define INV_METER_DRAW_L 1 #define INV_METER_DRAW_R 2 #define INV_METER_DRAW_MODE_TOZERO 0 #define INV_METER_DRAW_MODE_FROMZERO 1 #define INV_METER_DRAW_MODE_BIGTOZERO 2 #define INV_METER(obj) GTK_CHECK_CAST(obj, inv_meter_get_type (), InvMeter) #define INV_METER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_meter_get_type(), InvMeterClass) #define INV_IS_METER(obj) GTK_CHECK_TYPE(obj, inv_meter_get_type()) typedef struct _InvMeter InvMeter; typedef struct _InvMeterClass InvMeterClass; struct _InvMeter { GtkWidget widget; gint bypass; gint channels; gint mode; float LdB; float RdB; gint lastLpos; gint lastRpos; struct colour mOff60,mOff12,mOff6,mOff0,overOff; struct colour mOn60, mOn12, mOn6, mOn0, overOn; /* delta */ gint label_font_size,scale_font_size; }; struct _InvMeterClass { GtkWidgetClass parent_class; }; GtkType inv_meter_get_type(void); GtkWidget * inv_meter_new(); void inv_meter_set_bypass(InvMeter *meter, gint num); void inv_meter_set_mode(InvMeter *meter, gint num); void inv_meter_set_channels(InvMeter *meter, gint num); void inv_meter_set_LdB(InvMeter *meter, float num); void inv_meter_set_RdB(InvMeter *meter, float num); G_END_DECLS #endif /* __METER_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/widgets.c0000664000175000017500000000326611251515772023623 0ustar alessioalessio /* Common functions for invada widgets (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "math.h" #include "string.h" #include "widgets.h" gint inv_choose_light_dark(GdkColor *bg,GdkColor *light,GdkColor *dark) { float ld,dd; ld=pow(bg->red-light->red,2) + pow(bg->green-light->green,2) + pow(bg->blue-light->blue,2); dd=pow(bg->red-dark->red,2) + pow(bg->green-dark->green,2) + pow(bg->blue-dark->blue,2); return ld > dd ? 1 : 0; } gint inv_choose_font_size(cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight, double width, double height, const char *character) { cairo_text_extents_t extents; gint i; cairo_select_font_face(cr,family,slant,weight); for(i=15;i>0;i--) { cairo_set_font_size(cr,i); cairo_text_extents (cr,character,&extents); //printf("Char: %s, font %i, width: %f, height: %f\n",character,i,extents.width,extents.height); if(extents.width <= width && extents.height <= height) { return i; } } return 0; } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/lamp.h0000664000175000017500000000326511251515772023112 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __LAMP_H #define __LAMP_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_LAMP_DRAW_ALL 0 #define INV_LAMP_DRAW_DATA 1 #define INV_LAMP(obj) GTK_CHECK_CAST(obj, inv_lamp_get_type (), InvLamp) #define INV_LAMP_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_lamp_get_type(), InvLampClass) #define INV_IS_LAMP(obj) GTK_CHECK_TYPE(obj, inv_lamp_get_type()) typedef struct _InvLamp InvLamp; typedef struct _InvLampClass InvLampClass; struct _InvLamp { GtkWidget widget; float scale; float value; float lastValue; struct colour l0_r, l1_r, l2_r, l3_r, l4_r; struct colour l0_c, l1_c, l2_c, l3_c, l4_c; }; struct _InvLampClass { GtkWidgetClass parent_class; }; GtkType inv_lamp_get_type(void); GtkWidget * inv_lamp_new(); void inv_lamp_set_scale(InvLamp *lamp, float num); void inv_lamp_set_value(InvLamp *lamp, float num); void inv_lamp_set_tooltip(InvLamp *lamp, gchar *tip); G_END_DECLS #endif /* __LAMP_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-Compressor.h0000664000175000017500000000457511251515772025765 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DISPLAY_COMP_H #define __DISPLAY_COMP_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_DISPLAYCOMP_DRAW_ALL 0 #define INV_DISPLAYCOMP_DRAW_DATA 1 #define INV_DISPLAY_COMP(obj) GTK_CHECK_CAST(obj, inv_display_comp_get_type (), InvDisplayComp) #define INV_DISPLAY_COMP_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_display_comp_get_type(), InvDisplayCompClass) #define INV_IS_DISPLAY_COMP(obj) GTK_CHECK_TYPE(obj, inv_display_comp_get_type()) typedef struct _InvDisplayComp InvDisplayComp; typedef struct _InvDisplayCompClass InvDisplayCompClass; struct _InvDisplayComp { GtkWidget widget; gint bypass; float rms; float attack; float release; float threshold; float ratio; float gain; float Lastrms; float Lastattack; float Lastrelease; float Lastthreshold; float Lastratio; float Lastgain; float SIG[292], SIGmax; float RMS[292]; float ENV[292]; float header_font_size,label_font_size,info_font_size; }; struct _InvDisplayCompClass { GtkWidgetClass parent_class; }; GtkType inv_display_comp_get_type(void); GtkWidget * inv_display_comp_new(); void inv_display_comp_set_bypass(InvDisplayComp *displayComp, gint num); void inv_display_comp_set_rms(InvDisplayComp *displayComp, float num); void inv_display_comp_set_attack(InvDisplayComp *displayComp, float num); void inv_display_comp_set_release(InvDisplayComp *displayComp, float num); void inv_display_comp_set_threshold(InvDisplayComp *displayComp, float num); void inv_display_comp_set_ratio(InvDisplayComp *displayComp, float num); void inv_display_comp_set_gain(InvDisplayComp *displayComp, float num); G_END_DECLS #endif /* __DISPLAY_COMP_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/switch-toggle-img_off.xpm0000664000175000017500000002271311251515772026721 0ustar alessioalessio/* XPM */ static char * switch_toggle_img_off_xpm[] = { "25 25 516 2", " c None", ". c #CEB49A", "+ c #CCB096", "@ c #BBA187", "# c #AE947D", "$ c #CBB7A2", "% c #BEA893", "& c #967E6C", "* c #816B56", "= c #604534", "- c #7D624D", "; c #8B6B56", "> c #E3D9C5", ", c #D9C6AD", "' c #C5AB91", ") c #B49A82", "! c #E5D4C4", "~ c #FAF5F0", "{ c #FDF9F2", "] c #F1E8D9", "^ c #B3A08E", "/ c #88705C", "( c #442F21", "_ c #4A3427", ": c #624A3A", "< c #6D513D", "[ c #775A43", "} c #E7DECA", "| c #D9C9B3", "1 c #C1A78F", "2 c #AF9582", "3 c #E4D4C0", "4 c #FEFEFD", "5 c #FFFFFF", "6 c #F7EEDF", "7 c #DFCEB9", "8 c #AD8F71", "9 c #7C6043", "0 c #533B2A", "a c #4E3625", "b c #554031", "c c #574130", "d c #694E3F", "e c #ECE6D6", "f c #DDD0BD", "g c #CEB8A1", "h c #D2C3B8", "i c #D0BB9E", "j c #EFE5DC", "k c #F5ECDA", "l c #C1AA96", "m c #9F8671", "n c #745A42", "o c #63482C", "p c #462F20", "q c #503C2E", "r c #433126", "s c #473328", "t c #5B4334", "u c #F5F3E9", "v c #DBCEBC", "w c #E6DDCB", "x c #F4EFE9", "y c #D8C7B4", "z c #BA9E7F", "A c #F4EADD", "B c #FFFFFD", "C c #FEFDF9", "D c #F8EED9", "E c #F0E4CF", "F c #B59C84", "G c #9B7F66", "H c #6E5640", "I c #583F28", "J c #432C1B", "K c #3A2317", "L c #745B4A", "M c #3E2D21", "N c #59412E", "O c #F9F9F3", "P c #DDD3C2", "Q c #DCCCB8", "R c #F3EFE6", "S c #E3D6C2", "T c #D9CAB4", "U c #B6997E", "V c #D7C3AE", "W c #EBDAC4", "X c #F0DEC4", "Y c #EBD7B9", "Z c #A78E77", "` c #7C6148", " . c #745C4A", ".. c #543E2D", "+. c #261409", "@. c #1D0D06", "#. c #1C0E07", "$. c #6D5846", "%. c #735C4D", "&. c #3D2B21", "*. c #402D20", "=. c #584030", "-. c #F0EDE2", ";. c #CCB8A3", ">. c #E7DACC", ",. c #DDCEBC", "'. c #E1D3BD", "). c #DBCDBD", "!. c #8B715C", "~. c #AD9174", "{. c #B59D86", "]. c #C8AE95", "^. c #C5A98D", "/. c #7F6753", "(. c #5A4433", "_. c #614A37", ":. c #584231", "<. c #2F1C11", "[. c #130804", "}. c #0E0705", "|. c #816855", "1. c #725A49", "2. c #6C5644", "3. c #34261E", "4. c #412F23", "5. c #E0D4BF", "6. c #DED1BC", "7. c #CEB7A1", "8. c #E9E1D5", "9. c #D9C5AF", "0. c #DCCDB9", "a. c #EFECE0", "b. c #7D6550", "c. c #8B715A", "d. c #7B6453", "e. c #99826D", "f. c #957B62", "g. c #856D59", "h. c #8B6F52", "i. c #654D3C", "j. c #402916", "k. c #200B02", "l. c #070100", "m. c #2D211B", "n. c #866B58", "o. c #745B4B", "p. c #705B49", "q. c #46352B", "r. c #3B2A20", "s. c #423025", "t. c #E7E1CD", "u. c #CDB69B", "v. c #CAB6A2", "w. c #D3BFA7", "x. c #D7C3AB", "y. c #DACBB8", "z. c #EAE5D3", "A. c #A89178", "B. c #432C1D", "C. c #6E5541", "D. c #836C56", "E. c #987D65", "F. c #8C725C", "G. c #866D56", "H. c #745B46", "I. c #362213", "J. c #1B0E09", "K. c #0E0201", "L. c #5B483B", "M. c #9B806A", "N. c #826756", "O. c #6E5645", "P. c #5D483A", "Q. c #2D2017", "R. c #35271C", "S. c #D7C7AF", "T. c #AE9277", "U. c #D4BEA6", "V. c #C0A48B", "W. c #C1A890", "X. c #E2D5C0", "Y. c #CEB79E", "Z. c #8C745D", "`. c #79634B", " + c #2F1C12", ".+ c #6C5442", "++ c #9D7E5E", "@+ c #8C7058", "#+ c #876B51", "$+ c #674C34", "%+ c #27150B", "&+ c #080101", "*+ c #210D07", "=+ c #5D4A3D", "-+ c #9A806C", ";+ c #8E745E", ">+ c #735B47", ",+ c #715949", "'+ c #34251F", ")+ c #33251E", "!+ c #C8B299", "~+ c #9B7E67", "{+ c #CAB39A", "]+ c #BCA188", "^+ c #BDA58E", "/+ c #D4BCA2", "(+ c #BCA288", "_+ c #60472E", ":+ c #AB9371", "<+ c #807158", "[+ c #42301F", "}+ c #5F452F", "|+ c #745A48", "1+ c #634B39", "2+ c #382415", "3+ c #26190C", "4+ c #5C3F24", "5+ c #220B04", "6+ c #5C4436", "7+ c #866C59", "8+ c #967C67", "9+ c #755E4A", "0+ c #513E33", "a+ c #30221C", "b+ c #B1977D", "c+ c #A1846D", "d+ c #AF957D", "e+ c #B39981", "f+ c #AD927B", "g+ c #C2A88F", "h+ c #A78D74", "i+ c #6B4D2E", "j+ c #A9916C", "k+ c #AD9774", "l+ c #75522F", "m+ c #452810", "n+ c #3F2412", "o+ c #39200E", "p+ c #73553A", "q+ c #8B643E", "r+ c #684424", "s+ c #1A0400", "t+ c #4B392B", "u+ c #876D5B", "v+ c #9F876F", "w+ c #957C68", "x+ c #77604E", "y+ c #594537", "z+ c #271D16", "A+ c #AC9278", "B+ c #907460", "C+ c #A88E77", "D+ c #A18771", "E+ c #A28873", "F+ c #AD9279", "G+ c #8E735E", "H+ c #755126", "I+ c #AE9E79", "J+ c #AA926D", "K+ c #6C4B2D", "L+ c #41210A", "M+ c #3B1F0D", "N+ c #462308", "O+ c #866342", "P+ c #815E3E", "Q+ c #492710", "R+ c #1B0200", "S+ c #43372C", "T+ c #967B66", "U+ c #AF9780", "V+ c #A18770", "W+ c #7A614F", "X+ c #584435", "Y+ c #231A13", "Z+ c #9C8068", "`+ c #806452", " @ c #AB9079", ".@ c #A08670", "+@ c #9F836E", "@@ c #A58B74", "#@ c #8C735D", "$@ c #61421A", "%@ c #AC9C7A", "&@ c #AC9B78", "*@ c #8A653D", "=@ c #573413", "-@ c #3C1D07", ";@ c #411D04", ">@ c #765332", ",@ c #613E20", "'@ c #321102", ")@ c #0B0100", "!@ c #6C5C4F", "~@ c #9E836C", "{@ c #C7AD93", "]@ c #B79E85", "^@ c #846B58", "/@ c #644F3E", "(@ c #281B17", "_@ c #967C64", ":@ c #705442", "<@ c #9F856E", "[@ c #8A705E", "}@ c #947A64", "|@ c #9F866E", "1@ c #866E58", "2@ c #59482D", "3@ c #977E4E", "4@ c #B6B3A7", "5@ c #A89573", "6@ c #7E572D", "7@ c #563519", "8@ c #5A391A", "9@ c #603B17", "0@ c #472004", "a@ c #100300", "b@ c #0D0201", "c@ c #B2A193", "d@ c #B39980", "e@ c #D0B69D", "f@ c #B89E86", "g@ c #A18670", "h@ c #523F32", "i@ c #241915", "j@ c #947960", "k@ c #6F5642", "l@ c #8A715D", "m@ c #876B59", "n@ c #8B715D", "o@ c #977D68", "p@ c #8C725D", "q@ c #735B48", "r@ c #837552", "s@ c #A9A48C", "t@ c #ABA592", "u@ c #9F8966", "v@ c #8F683E", "w@ c #724822", "x@ c #381E0C", "y@ c #090000", "z@ c #170100", "A@ c #795D56", "B@ c #AB907D", "C@ c #D2BBA2", "D@ c #D5BEA6", "E@ c #A98F79", "F@ c #A78B74", "G@ c #2C1F17", "H@ c #1C1512", "I@ c #826752", "J@ c #7B624D", "K@ c #6E5746", "L@ c #8E745D", "M@ c #937762", "N@ c #816856", "O@ c #624E3C", "P@ c #755E40", "Q@ c #8A6837", "R@ c #60320B", "S@ c #6A350A", "T@ c #561901", "U@ c #310300", "V@ c #340700", "W@ c #6A4039", "X@ c #BAA492", "Y@ c #B0957D", "Z@ c #DCCCB7", "`@ c #DACAB4", " # c #B79C84", ".# c #866C58", "+# c #1F1612", "@# c #1F1713", "## c #836951", "$# c #7C634D", "%# c #533F30", "&# c #856B58", "*# c #846955", "=# c #8F7560", "-# c #8D735E", ";# c #846A57", "># c #7B614F", ",# c #38261A", "'# c #080403", ")# c #250B00", "!# c #290E02", "~# c #281612", "{# c #887369", "]# c #B29B89", "^# c #BCA189", "/# c #DCCBB5", "(# c #E4D9C5", "_# c #C4AC94", ":# c #C0A88F", "<# c #3E2C25", "[# c #191211", "}# c #1B1510", "|# c #795D4C", "1# c #624B3B", "2# c #564234", "3# c #856B57", "4# c #7B6351", "5# c #8D745E", "6# c #8F745F", "7# c #907662", "8# c #846A58", "9# c #7D6453", "0# c #856C59", "a# c #917761", "b# c #987D68", "c# c #907562", "d# c #B49A81", "e# c #D6C5AF", "f# c #C9B39C", "g# c #C4A990", "h# c #796352", "i# c #1C1313", "j# c #140F0D", "k# c #71553E", "l# c #6C5341", "m# c #4D3B2B", "n# c #685244", "o# c #7C6251", "p# c #8A705C", "q# c #8F7562", "r# c #907560", "s# c #866D59", "t# c #876C5A", "u# c #9A806A", "v# c #B69B82", "w# c #CDB39B", "x# c #D5C0A8", "y# c #B8A28F", "z# c #B79C85", "A# c #97806B", "B# c #241814", "C# c #140F0E", "D# c #17110F", "E# c #634A36", "F# c #664F3D", "G# c #453327", "H# c #634C3E", "I# c #7D6350", "J# c #7F6652", "K# c #7D6552", "L# c #977D66", "M# c #9D836C", "N# c #A0866E", "O# c #A98F77", "P# c #B3987F", "Q# c #B49982", "R# c #BAA088", "S# c #AD917B", "T# c #BCA18A", "U# c #98806C", "V# c #2F201C", "W# c #160F0F", "X# c #0E0E0D", "Y# c #624B36", "Z# c #604B39", "`# c #4C392B", " $ c #543F33", ".$ c #7B624F", "+$ c #79604F", "@$ c #866C5B", "#$ c #8D755F", "$$ c #8F7662", "%$ c #917864", "&$ c #957B67", "*$ c #816654", "=$ c #8A6F5C", "-$ c #9B836E", ";$ c #665044", ">$ c #291C18", ",$ c #1A1210", "'$ c #181212", ")$ c #5C4433", "!$ c #5D4536", "~$ c #4D3A2C", "{$ c #49362A", "]$ c #5B4639", "^$ c #755D4C", "/$ c #755E4B", "($ c #806856", "_$ c #8A735F", ":$ c #796150", "<$ c #564238", "[$ c #31201B", "}$ c #211814", "|$ c #16100E", "1$ c #16110F", "2$ c #543D30", "3$ c #574234", "4$ c #4B382B", "5$ c #453328", "6$ c #433025", "7$ c #3E2C22", "8$ c #3E2D23", "9$ c #402F25", "0$ c #382921", "a$ c #2B1E19", "b$ c #271C17", "c$ c #251A16", "d$ c #1E1511", "e$ c #15100F", "f$ c #161111", "g$ c #48342A", "h$ c #46342C", "i$ c #412F26", "j$ c #3C2A23", "k$ c #37261E", "l$ c #2E2119", "m$ c #291E19", "n$ c #211915", "o$ c #211816", "p$ c #1C1614", "q$ c #1F1815", " . + @ # $ % & * = - ; ", " > , ' ) ! ~ { ] ^ / ( _ : < [ ", " } | 1 2 3 4 5 5 6 7 8 9 0 a b c d ", " e f g h i j 5 5 5 k l m n o p q r s t ", " u v w x y z A B C D E F G H I J K L r M N ", " O P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=. ", " -.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4. ", "5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.", "t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.", "S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+", "!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+ .0+a+", "b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+", "A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+", "Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@", "_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@", "j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@", "I@J@K@L@n@n@M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@#", "##$#%#&#|.*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#", " |#1#2#3#4#5#6#7#8#9#0#a#M.b#c#d#e#Z@f#g#h#i#j# ", " k#l#m#n#o#o#p#q#r#q#s#t#u#<@v#w#x#y#z#A#B#C#D# ", " E#F#G#H#I#J#K#=#L#M#N#O#P#Q#R#S#T#U#V#W#X# ", " Y#Z#`# $.$+$1.@$#$$$%$&$*$=$-$;$>$,$'$ ", " )$!$~${$]$^$/$^$($o#_$:$<$[$}$|$1$ ", " 2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$ ", " g$h$i$j$k$l$m$n$o$p$q$ "}; invada-studio-plugins-lv2-1.2.0/plugingui/widgets/display-ErReverb.c0000664000175000017500000010551411251515772025333 0ustar alessioalessio/* This widget provides a display for Early Reflection Reverbs (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "widgets.h" #include "../../plugin/library/common.h" #include "display-ErReverb.h" static void inv_display_err_class_init(InvDisplayErrClass *klass); static void inv_display_err_init(InvDisplayErr *displayErr); static void inv_display_err_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_display_err_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_display_err_realize(GtkWidget *widget); static gboolean inv_display_err_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_display_err_paint(GtkWidget *widget, gint mode); static void inv_display_err_destroy(GtkObject *object); static gboolean inv_display_err_button_press_event (GtkWidget *widget, GdkEventButton *event); static gboolean inv_display_err_motion_notify_event(GtkWidget *widget, GdkEventMotion *event); static gboolean inv_display_err_button_release_event(GtkWidget *widget, GdkEventButton *event); static void inv_display_err_screen(struct point3D *point, struct point2D * screen, struct point3D * camera, struct point3D *lookat); static gint inv_display_err_find_active_dot(float l, float w, float sLR, float sFB, float dLR, float dFB, float x, float y); static void inv_display_err_update_active_dot(gint dot, float l, float w, float x, float y, float *LR, float *FB); GtkType inv_display_err_get_type(void) { static GtkType inv_display_err_type = 0; char *name; int i; if (!inv_display_err_type) { static const GTypeInfo type_info = { sizeof(InvDisplayErrClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_display_err_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvDisplayErr), 0, /* n_preallocs */ (GInstanceInitFunc)inv_display_err_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvDisplayErr-%p-%d",inv_display_err_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_display_err_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_display_err_type; } gint inv_display_err_get_active_dot(InvDisplayErr *displayErr) { return displayErr->active_dot; } void inv_display_err_set_bypass(InvDisplayErr *displayErr, gint num) { displayErr->bypass = num; } float inv_display_err_get_source(InvDisplayErr *displayErr, gint axis) { return displayErr->source[axis]; } float inv_display_err_get_dest(InvDisplayErr *displayErr, gint axis){ return displayErr->dest[axis]; } void inv_display_err_set_room(InvDisplayErr *displayErr, gint axis, float num) { switch(axis) { case INV_DISPLAY_ERR_ROOM_LENGTH: case INV_DISPLAY_ERR_ROOM_WIDTH: if(num<3) num=3; if(num>100) num=100; displayErr->room[axis]=num; break; case INV_DISPLAY_ERR_ROOM_HEIGHT: if(num<3) num=3; if(num>30) num=30; displayErr->room[axis]=num; break; } if(displayErr->room[axis] != displayErr->Lastroom[axis]) { if(GTK_WIDGET_REALIZED(displayErr)) inv_display_err_paint(GTK_WIDGET(displayErr),INV_DISPLAY_ERR_DRAW_DATA); } } void inv_display_err_set_source(InvDisplayErr *displayErr, gint axis, float num) { switch(axis) { case INV_DISPLAY_ERR_LR: if(num<-1) num=-1; if(num>1) num=1; displayErr->source[axis]=num; break; case INV_DISPLAY_ERR_FB: if(num<0.51) num=0.51; if(num>0.99) num=0.99; displayErr->source[axis]=num; break; } if(displayErr->source[axis] != displayErr->Lastsource[axis]) { if(GTK_WIDGET_REALIZED(displayErr)) inv_display_err_paint(GTK_WIDGET(displayErr),INV_DISPLAY_ERR_DRAW_DATA); } } void inv_display_err_set_dest(InvDisplayErr *displayErr, gint axis, float num) { switch(axis) { case INV_DISPLAY_ERR_LR: if(num<-1) num=-1; if(num>1) num=1; displayErr->dest[axis]=num; break; case INV_DISPLAY_ERR_FB: if(num<0.01) num=0.01; if(num>0.49) num=0.49; displayErr->dest[axis]=num; break; } if(displayErr->dest[axis] != displayErr->Lastdest[axis]) { if(GTK_WIDGET_REALIZED(displayErr)) inv_display_err_paint(GTK_WIDGET(displayErr),INV_DISPLAY_ERR_DRAW_DATA); } } void inv_display_err_set_diffusion(InvDisplayErr *displayErr, float num) { if(num<0) num=0; if(num>100) num=1; displayErr->diffusion=num/100; if(displayErr->diffusion != displayErr->Lastdiffusion) { if(GTK_WIDGET_REALIZED(displayErr)) inv_display_err_paint(GTK_WIDGET(displayErr),INV_DISPLAY_ERR_DRAW_DATA); } } GtkWidget * inv_display_err_new() { return GTK_WIDGET(gtk_type_new(inv_display_err_get_type())); } static void inv_display_err_class_init(InvDisplayErrClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_display_err_realize; widget_class->size_request = inv_display_err_size_request; widget_class->size_allocate = inv_display_err_size_allocate; widget_class->expose_event = inv_display_err_expose; widget_class->button_press_event = inv_display_err_button_press_event; widget_class->motion_notify_event = inv_display_err_motion_notify_event; widget_class->button_release_event = inv_display_err_button_release_event; object_class->destroy = inv_display_err_destroy; } static void inv_display_err_init(InvDisplayErr *displayErr) { displayErr->bypass=INV_PLUGIN_ACTIVE; displayErr->active_dot=INV_DISPLAY_ERR_DOT_NONE; displayErr->room[INV_DISPLAY_ERR_ROOM_LENGTH]=25.0; displayErr->room[INV_DISPLAY_ERR_ROOM_WIDTH]=30.0; displayErr->room[INV_DISPLAY_ERR_ROOM_HEIGHT]=10.0; displayErr->source[INV_DISPLAY_ERR_LR]=-0.01; displayErr->source[INV_DISPLAY_ERR_FB]=0.8; displayErr->dest[INV_DISPLAY_ERR_LR]=0.01; displayErr->dest[INV_DISPLAY_ERR_FB]=0.2; displayErr->diffusion=50.0; displayErr->Lastroom[INV_DISPLAY_ERR_ROOM_LENGTH]=25.0; displayErr->Lastroom[INV_DISPLAY_ERR_ROOM_WIDTH]=30.0; displayErr->Lastroom[INV_DISPLAY_ERR_ROOM_HEIGHT]=10.0; displayErr->Lastsource[INV_DISPLAY_ERR_LR]=-0.01; displayErr->Lastsource[INV_DISPLAY_ERR_FB]=0.8; displayErr->Lastdest[INV_DISPLAY_ERR_LR]=0.01; displayErr->Lastdest[INV_DISPLAY_ERR_FB]=0.2; displayErr->Lastdiffusion=50.0; displayErr->er=(struct ERunit *)malloc(sizeof(struct ERunit) * MAX_ER); displayErr->er_size=0; displayErr->header_font_size=0; displayErr->info_font_size=0; GTK_WIDGET_SET_FLAGS (GTK_WIDGET(displayErr), GTK_CAN_FOCUS); gtk_widget_set_tooltip_markup(GTK_WIDGET(displayErr),"Room Shape: This is a 3D representation of the virtual room.\nImpulse Response: This shows the resultant inpulse response of the room.\nSource and Listerner Position: Use this display to position the source and listener in the virtual room."); } static void inv_display_err_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_ERR(widget)); g_return_if_fail(requisition != NULL); requisition->width = 510; requisition->height = 300; } static void inv_display_err_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_ERR(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_display_err_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_DISPLAY_ERR(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 510; attributes.height = 300; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_display_err_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_DISPLAY_ERR(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_display_err_paint(widget,INV_DISPLAY_ERR_DRAW_ALL); return FALSE; } static void inv_display_err_paint(GtkWidget *widget, gint mode) { gint active_dot; gint bypass; float w,l,h; float sLR,sFB; float dLR,dFB; float diffusion; struct ERunit *er; gint er_size; gint i; float sw,sl,scale; float x,y,xc,yc,r; struct point3D camera,lookat,source,dest,sourceF,destF; struct point2D sourceS,destS,sourceSF,destSF; struct point3D room[8]; struct point2D roomS[8]; float minx,maxx,miny,maxy,sx,sy,dist; char label[30]; float min_delay,max_delay,max_gain; cairo_t *cr; GtkStyle *style; cairo_text_extents_t extents; bypass=INV_DISPLAY_ERR(widget)->bypass; active_dot=INV_DISPLAY_ERR(widget)->active_dot; l=INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_LENGTH]; w=INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_WIDTH]; h=INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_HEIGHT]; sLR=INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_LR]; sFB=INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_FB]; dLR=INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_LR]; dFB=INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_FB]; diffusion=INV_DISPLAY_ERR(widget)->diffusion; er=INV_DISPLAY_ERR(widget)->er; er_size=INV_DISPLAY_ERR(widget)->er_size; style = gtk_widget_get_style(widget); cr = gdk_cairo_create(widget->window); if(INV_DISPLAY_ERR(widget)->header_font_size==0) { INV_DISPLAY_ERR(widget)->header_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,8.1,"0"); } if(INV_DISPLAY_ERR(widget)->info_font_size==0) { INV_DISPLAY_ERR(widget)->info_font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0"); } if(mode==INV_DISPLAY_ERR_DRAW_ALL) { cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_line_width(cr,1); for(i=0;i<2;i++) { cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, (i*150)+149); cairo_line_to(cr, 0, (i*150)); cairo_line_to(cr, 209, (i*150)); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 0, (i*150)+149); cairo_line_to(cr, 209, (i*150)+149); cairo_line_to(cr, 209, (i*150)); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 1, (i*150)+1, 208, 148 ); cairo_fill(cr); } cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, 210, 299); cairo_line_to(cr, 210, 0); cairo_line_to(cr, 509, 0); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, 210, 299); cairo_line_to(cr, 509, 299); cairo_line_to(cr, 509, 0); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 211, 1, 318, 298 ); cairo_fill(cr); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } cairo_set_font_size(cr,INV_DISPLAY_ERR(widget)->header_font_size); sprintf(label,"Source And Listener Position"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,360-(extents.width/2),11); cairo_show_text(cr,label); cairo_set_font_size(cr,INV_DISPLAY_ERR(widget)->info_font_size); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } sprintf(label,"(click and drag to move)"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,360-(extents.width/2),21); cairo_show_text(cr,label); cairo_set_font_size(cr,INV_DISPLAY_ERR(widget)->header_font_size); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } sprintf(label,"Room Shape"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,105-(extents.width/2),11); cairo_show_text(cr,label); sprintf(label,"Impulse Response"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,105-(extents.width/2),161); cairo_show_text(cr,label); } /* room display */ /* 200x140 centered at 105,75 */ if(l!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_LENGTH] || w!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_WIDTH] || h!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_HEIGHT] || sLR!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_LR] || sFB!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_FB] || dLR!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_LR] || dFB!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_FB] || mode==INV_DISPLAY_ERR_DRAW_ALL) { camera.x=4*l; camera.y=(2*h)+((w+l)/2); camera.z=3*w; lookat.x=0; lookat.y=0; lookat.z=0; dist=log10(pow(camera.x*camera.x+camera.y*camera.y+camera.z+camera.z,0.5)); source.x=sLR*w/2; source.y=1.5-h/2; source.z=((1-sFB)*l)-(l/2); sourceF.x=source.x; sourceF.y=-h/2; sourceF.z=source.z; dest.x=dLR*w/2; dest.y=1.5-h/2; dest.z=((1-dFB)*l)-(l/2); destF.x=dest.x; destF.y=-h/2; destF.z=dest.z; room[0].x=-w/2; room[0].y=h/2; room[0].z=-l/2; room[1].x=w/2; room[1].y=h/2; room[1].z=-l/2; room[2].x=w/2; room[2].y=h/2; room[2].z=l/2; room[3].x=-w/2; room[3].y=h/2; room[3].z=l/2; room[4].x=-w/2; room[4].y=-h/2; room[4].z=-l/2; room[5].x=w/2; room[5].y=-h/2; room[5].z=-l/2; room[6].x=w/2; room[6].y=-h/2; room[6].z=l/2; room[7].x=-w/2; room[7].y=-h/2; room[7].z=l/2; inv_display_err_screen(&source,&sourceS,&camera,&lookat); inv_display_err_screen(&sourceF,&sourceSF,&camera,&lookat); inv_display_err_screen(&dest,&destS,&camera,&lookat); inv_display_err_screen(&destF,&destSF,&camera,&lookat); sx=0; sy=0; minx=9999999; maxx=-9999999; miny=9999999; maxy=-9999999; //project to screen for(i=0;i<8;i++) { inv_display_err_screen(&room[i],&roomS[i],&camera,&lookat); minx = roomS[i].x < minx ? roomS[i].x : minx; maxx = roomS[i].x > maxx ? roomS[i].x : maxx; miny = roomS[i].y < miny ? roomS[i].y : miny; maxy = roomS[i].y > maxy ? roomS[i].y : maxy; } //center sourceS.x=sourceS.x-(minx+maxx)/2; sourceS.y=sourceS.y-(miny+maxy)/2; sourceSF.x=sourceSF.x-(minx+maxx)/2; sourceSF.y=sourceSF.y-(miny+maxy)/2; destS.x=destS.x-(minx+maxx)/2; destS.y=destS.y-(miny+maxy)/2; destSF.x=destSF.x-(minx+maxx)/2; destSF.y=destSF.y-(miny+maxy)/2; for(i=0;i<8;i++) { roomS[i].x=roomS[i].x-(minx+maxx)/2; roomS[i].y=roomS[i].y-(miny+maxy)/2; } //scale sx = 93/fabs((maxx-minx)/2); sy = 65/fabs((maxy-miny)/2); scale = sx > sy ? sy : sx; //plot with scale if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 3, 13, 204, 134 ); cairo_fill(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_line_width(cr,3-dist); cairo_set_source_rgb(cr, 0.18, 0.18, 0.18); } else { cairo_set_line_width(cr,4-dist); cairo_set_source_rgb(cr, 0.0, 0.05, 0.5); } cairo_move_to(cr,105+roomS[4].x*scale,80-roomS[4].y*scale); cairo_line_to(cr,105+roomS[5].x*scale,80-roomS[5].y*scale); cairo_move_to(cr,105+roomS[4].x*scale,80-roomS[4].y*scale); cairo_line_to(cr,105+roomS[0].x*scale,80-roomS[0].y*scale); cairo_move_to(cr,105+roomS[4].x*scale,80-roomS[4].y*scale); cairo_line_to(cr,105+roomS[7].x*scale,80-roomS[7].y*scale); cairo_stroke(cr); r=5-dist; if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 0.8, 0.8, 0.0); } cairo_set_line_width(cr,1); cairo_move_to(cr,105+sourceSF.x*scale,80-sourceSF.y*scale); cairo_line_to(cr,105+sourceS.x*scale,80-sourceS.y*scale); cairo_stroke(cr); cairo_arc(cr,105+sourceS.x*scale,80-sourceS.y*scale,r,0,2*INV_PI); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } else { cairo_set_source_rgb(cr, 1.0, 0.1, 0.0); } cairo_move_to(cr,105+destSF.x*scale,80-destSF.y*scale); cairo_line_to(cr,105+destS.x*scale,80-destS.y*scale); cairo_stroke(cr); cairo_arc(cr,105+destS.x*scale,80-destS.y*scale,r,0,2*INV_PI); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_line_width(cr,3-dist); cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_line_width(cr,4-dist); cairo_set_source_rgb(cr, 0.0, 0.1, 1.0); } cairo_move_to(cr,105+roomS[0].x*scale,80-roomS[0].y*scale); cairo_line_to(cr,105+roomS[1].x*scale,80-roomS[1].y*scale); cairo_move_to(cr,105+roomS[1].x*scale,80-roomS[1].y*scale); cairo_line_to(cr,105+roomS[2].x*scale,80-roomS[2].y*scale); cairo_move_to(cr,105+roomS[2].x*scale,80-roomS[2].y*scale); cairo_line_to(cr,105+roomS[3].x*scale,80-roomS[3].y*scale); cairo_move_to(cr,105+roomS[3].x*scale,80-roomS[3].y*scale); cairo_line_to(cr,105+roomS[0].x*scale,80-roomS[0].y*scale); cairo_move_to(cr,105+roomS[5].x*scale,80-roomS[5].y*scale); cairo_line_to(cr,105+roomS[6].x*scale,80-roomS[6].y*scale); cairo_move_to(cr,105+roomS[6].x*scale,80-roomS[6].y*scale); cairo_line_to(cr,105+roomS[7].x*scale,80-roomS[7].y*scale); cairo_move_to(cr,105+roomS[1].x*scale,80-roomS[1].y*scale); cairo_line_to(cr,105+roomS[5].x*scale,80-roomS[5].y*scale); cairo_move_to(cr,105+roomS[2].x*scale,80-roomS[2].y*scale); cairo_line_to(cr,105+roomS[6].x*scale,80-roomS[6].y*scale); cairo_move_to(cr,105+roomS[3].x*scale,80-roomS[3].y*scale); cairo_line_to(cr,105+roomS[7].x*scale,80-roomS[7].y*scale); cairo_stroke(cr); } /* impulse response display */ /* any change alters this display */ /* 200x140 centered at 105,225 */ if(l!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_LENGTH] || w!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_WIDTH] || h!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_HEIGHT] || sLR!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_LR] || sFB!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_FB] || dLR!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_LR] || dFB!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_FB] || diffusion!=INV_DISPLAY_ERR(widget)->Lastdiffusion || mode==INV_DISPLAY_ERR_DRAW_ALL) { min_delay=9999999; max_delay=0; max_gain=0; er_size=calculateIReverbER(er, MAX_ER, w, l, h, sLR, sFB, dLR, dFB, 1.5, diffusion, SPEED_OF_SOUND); for(i=0;iDelayActual < min_delay ? er->DelayActual : min_delay; max_delay=er->DelayActual > max_delay ? er->DelayActual : max_delay; max_gain=fabs(er->GainL) > max_gain ? fabs(er->GainL) : max_gain; max_gain=fabs(er->GainR) > max_gain ? fabs(er->GainR) : max_gain; er++; } if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 3, 163, 204, 134 ); cairo_fill(cr); // show min and max cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } cairo_set_font_size(cr,INV_DISPLAY_ERR(widget)->info_font_size); sprintf(label,"Pre-Delay:"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,160-extents.width,286); cairo_show_text(cr,label); sprintf(label,"%.1fms",min_delay); cairo_move_to(cr,165,286); cairo_show_text(cr,label); sprintf(label,"Length:"); cairo_text_extents (cr,label,&extents); cairo_move_to(cr,160-extents.width,295); cairo_show_text(cr,label); sprintf(label,"%.1fms",max_delay); cairo_move_to(cr,165,295); cairo_show_text(cr,label); //show impulse repsonse max_delay= ((gint)(max_delay/25 )+2) * 25; er=INV_DISPLAY_ERR(widget)->er; //show axis cairo_rectangle(cr, 5, 163, 1, 134 ); cairo_fill(cr); cairo_rectangle(cr, 5, 230, 200, 1 ); cairo_fill(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_set_line_width(cr,1); for(i=0;iDelayActual/max_delay); y=2+fabs(er->GainL/max_gain)*65; if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.5); } else { cairo_set_source_rgba(cr, 0.2, 0.0, 1.0, 0.5); } cairo_rectangle(cr, x,230, 1, -y ); cairo_fill(cr); y=2+fabs(er->GainR/max_gain)*65; if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.4, 0.4, 0.4, 0.5); } else { cairo_set_source_rgba(cr, 0.0, 0.2, 1.0, 0.5); } cairo_rectangle(cr, x,230, 1, y ); cairo_fill(cr); er++; } } /* source dest display */ /* 310x280 centered at 350,155 */ if(l!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_LENGTH] || w!=INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_WIDTH] || sLR!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_LR] || sFB!=INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_FB] || dLR!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_LR] || dFB!=INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_FB] || mode==INV_DISPLAY_ERR_DRAW_ALL) { sw=pow(w,0.5); sl=pow(l,0.5); scale=9999999; scale = 290/sw < scale ? 290/sw : scale; scale = 268/sl < scale ? 268/sl : scale; sw=sw*scale/2; sl=sl*scale/2; if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); } else { cairo_set_source_rgb(cr, 0.05, 0.05, 0.2); } cairo_rectangle(cr, 213, 24, 294, 272 ); cairo_fill(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); if(active_dot==INV_DISPLAY_ERR_DOT_SOURCE) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.2); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 0.5, 0.2); } cairo_rectangle(cr, 360-(sw*0.99), 160-(sl*0.99), sw*1.98, sl*0.98 ); cairo_fill_preserve(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.5); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 0.5, 0.5); } cairo_stroke(cr); } else { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.05); } else { cairo_set_source_rgba(cr, 1.0, 1.0, 0.5, 0.05); } cairo_rectangle(cr, 360-(sw*0.99), 160-(sl*0.99), sw*1.98, sl*0.98 ); cairo_fill(cr); } if(active_dot==INV_DISPLAY_ERR_DOT_DEST) { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.2); } else { cairo_set_source_rgba(cr, 1.0, 0.5, 0.5, 0.2); } cairo_rectangle(cr, 360-(sw*0.99), 160+(sl*0.01), sw*1.98, sl*0.98 ); cairo_fill_preserve(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.5); } else { cairo_set_source_rgba(cr, 1.0, 0.5, 0.5, 0.5); } cairo_stroke(cr); } else { if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 0.05); } else { cairo_set_source_rgba(cr, 1.0, 0.5, 0.5, 0.05); } cairo_rectangle(cr, 360-(sw*0.99), 160+(sl*0.01), sw*1.98, sl*0.98 ); cairo_fill(cr); } cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); } else { cairo_set_source_rgb(cr, 0.35, 0.35, 0.35); } cairo_rectangle(cr, 360-sw, 160-sl, sw*2, sl*2 ); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); xc=360.0 + sLR*sw; yc=160+sl - sFB*sl*2; r=3; if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.8, 0.8, 0.0); } cairo_arc(cr,xc,yc,r,0,2*INV_PI); cairo_fill(cr); if(bypass==INV_PLUGIN_BYPASS) { cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); } else { cairo_set_source_rgb(cr, 0.5, 0.5, 0.3); } cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr,INV_DISPLAY_ERR(widget)->info_font_size); strcpy(label,"Source"); cairo_text_extents (cr,label,&extents); if(linfo_font_size); strcpy(label,"Listener"); cairo_text_extents (cr,label,&extents); if(lLastroom[INV_DISPLAY_ERR_ROOM_LENGTH]=l; INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_WIDTH]=w; INV_DISPLAY_ERR(widget)->Lastroom[INV_DISPLAY_ERR_ROOM_HEIGHT]=h; INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_LR]=sLR; INV_DISPLAY_ERR(widget)->Lastsource[INV_DISPLAY_ERR_FB]=sFB; INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_LR]=dLR; INV_DISPLAY_ERR(widget)->Lastdest[INV_DISPLAY_ERR_FB]=dFB; INV_DISPLAY_ERR(widget)->Lastdiffusion=diffusion; cairo_destroy(cr); } static void inv_display_err_destroy(GtkObject *object) { InvDisplayErrClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_DISPLAY_ERR(object)); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static gboolean inv_display_err_button_press_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_DISPLAY_ERR(widget)); INV_DISPLAY_ERR(widget)->active_dot=inv_display_err_find_active_dot( INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_LENGTH], INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_WIDTH], INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_LR], INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_FB], INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_LR], INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_FB], event->x, event->y); if(INV_DISPLAY_ERR(widget)->active_dot == INV_DISPLAY_ERR_DOT_SOURCE || INV_DISPLAY_ERR(widget)->active_dot == INV_DISPLAY_ERR_DOT_DEST) { g_object_set(G_OBJECT(widget),"has-tooltip",FALSE,NULL); gtk_widget_set_state(widget,GTK_STATE_ACTIVE); gtk_widget_grab_focus(widget); inv_display_err_paint(widget,INV_DISPLAY_ERR_DRAW_DATA); } return TRUE; } static gboolean inv_display_err_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) { g_assert(INV_IS_DISPLAY_ERR(widget)); switch(INV_DISPLAY_ERR(widget)->active_dot) { case INV_DISPLAY_ERR_DOT_SOURCE: inv_display_err_update_active_dot(INV_DISPLAY_ERR_DOT_SOURCE, INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_LENGTH], INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_WIDTH], event->x, event->y, &(INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_LR]), &(INV_DISPLAY_ERR(widget)->source[INV_DISPLAY_ERR_FB])); inv_display_err_paint(widget,INV_DISPLAY_ERR_DRAW_DATA); return FALSE; break; case INV_DISPLAY_ERR_DOT_DEST: inv_display_err_update_active_dot(INV_DISPLAY_ERR_DOT_DEST, INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_LENGTH], INV_DISPLAY_ERR(widget)->room[INV_DISPLAY_ERR_ROOM_WIDTH], event->x, event->y, &(INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_LR]), &(INV_DISPLAY_ERR(widget)->dest[INV_DISPLAY_ERR_FB])); inv_display_err_paint(widget,INV_DISPLAY_ERR_DRAW_DATA); return FALSE; break; } return TRUE; } static gboolean inv_display_err_button_release_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_DISPLAY_ERR(widget)); if(INV_DISPLAY_ERR(widget)->active_dot == INV_DISPLAY_ERR_DOT_SOURCE || INV_DISPLAY_ERR(widget)->active_dot == INV_DISPLAY_ERR_DOT_DEST) { INV_DISPLAY_ERR(widget)->active_dot= INV_DISPLAY_ERR_DOT_NONE; gtk_widget_set_state(widget,GTK_STATE_NORMAL); g_object_set(G_OBJECT(widget),"has-tooltip",TRUE,NULL); inv_display_err_paint(widget,INV_DISPLAY_ERR_DRAW_DATA); } return TRUE; } static void inv_display_err_screen(struct point3D *point, struct point2D *screen, struct point3D *camera, struct point3D *lookat) { struct point3D CameraLookV; // a vector describing where the camera is looking struct point3D ScreenXP; // the x dimension of the plane the image is projected onto struct point3D ScreenYP; // the y dimension of the plane the image is projected onto struct point3D CameraPointV; // a vector describing where the point is in relation to the camera struct point3D ProjectedP; // the location of the projected point on the x/y screen struct point3D ProjectedPCenter; // the location of the projected point on the x/y screen relative to the lookat point float CameraLookVLengthSqr,CameraLookVLength; float ScreenXPLength; float ScreenYPLength; float d,t; //Establish the Vector Components of the Camera-to-Center Vector CameraLookV.x = (lookat->x - camera->x); CameraLookV.y = (lookat->y - camera->y); CameraLookV.z = (lookat->z - camera->z); CameraLookVLengthSqr = CameraLookV.x*CameraLookV.x + CameraLookV.y*CameraLookV.y + CameraLookV.z*CameraLookV.z; CameraLookVLength = pow(CameraLookVLengthSqr,0.5); // x plane of the projection ScreenXP.x = -CameraLookV.z; ScreenXP.y = 0; ScreenXP.z = CameraLookV.x; ScreenXPLength = pow(ScreenXP.x*ScreenXP.x + ScreenXP.y*ScreenXP.y + ScreenXP.z*ScreenXP.z, 0.5); ScreenXP.x = ScreenXP.x / ScreenXPLength; ScreenXP.y = ScreenXP.y / ScreenXPLength; ScreenXP.z = ScreenXP.z / ScreenXPLength; // y plane of the projection ScreenYP.x = -(ScreenXP.z * CameraLookV.y); ScreenYP.y = (ScreenXP.z * CameraLookV.x) - (ScreenXP.x * CameraLookV.z); ScreenYP.z = (ScreenXP.x * CameraLookV.y); ScreenYPLength = pow(ScreenYP.x*ScreenYP.x + ScreenYP.y*ScreenYP.y + ScreenYP.z*ScreenYP.z, 0.5); ScreenYP.x = ScreenYP.x / ScreenYPLength; ScreenYP.y = ScreenYP.y / ScreenYPLength; ScreenYP.z = ScreenYP.z / ScreenYPLength; // scale by the camera distance ScreenXP.x = ScreenXP.x / CameraLookVLength; ScreenXP.y = ScreenXP.y / CameraLookVLength; ScreenXP.z = ScreenXP.z / CameraLookVLength; ScreenYP.x = ScreenYP.x / CameraLookVLength; ScreenYP.y = ScreenYP.y / CameraLookVLength; ScreenYP.z = ScreenYP.z / CameraLookVLength; // point -> camera vector CameraPointV.x = point->x - camera->x; CameraPointV.y = point->y - camera->y; CameraPointV.z = point->z - camera->z; // find where the vector intesects the projection plane d = (CameraPointV.x * CameraLookV.x) + (CameraPointV.y * CameraLookV.y) + (CameraPointV.z * CameraLookV.y); t = CameraLookVLengthSqr / d; ProjectedP.x = camera->x + CameraPointV.x*t; ProjectedP.y = camera->y + CameraPointV.y*t; ProjectedP.z = camera->z + CameraPointV.z*t ; //convert relative to lookat point ProjectedPCenter.x = (ProjectedP.x - lookat->x); ProjectedPCenter.y = (ProjectedP.y - lookat->y); ProjectedPCenter.z = (ProjectedP.z - lookat->z); // find screen coordinates screen->x = (ProjectedPCenter.x*ScreenXP.x) + (ProjectedPCenter.y*ScreenXP.y) + (ProjectedPCenter.z*ScreenXP.z); screen->y = (ProjectedPCenter.x*ScreenYP.x) + (ProjectedPCenter.y*ScreenYP.y) + (ProjectedPCenter.z*ScreenYP.z); // printf("point: x %f, y %f, z %f, screen: x %f, y %f\n",point->x,point->y,point->z,screen->x,screen->y); } static gint inv_display_err_find_active_dot(float l, float w, float sLR, float sFB, float dLR, float dFB, float x, float y) { float sl,sw,scale,sx,sy,dx,dy,sdist,ddist; sw=pow(w,0.5); sl=pow(l,0.5); scale=9999999; scale = 290/sw < scale ? 290/sw : scale; scale = 268/sl < scale ? 268/sl : scale; sw=sw*scale/2; sl=sl*scale/2; sx=360.0 + sLR*sw; sy=160+sl - sFB*sl*2; dx=360.0 + dLR*sw; dy=160+sl - dFB*sl*2; sdist=pow(pow(sx-x,2)+pow(sy-y,2),0.5); ddist=pow(pow(dx-x,2)+pow(dy-y,2),0.5); if(sdist<5.0 && sdist 0.99) *LR = 0.99; switch(dot) { case INV_DISPLAY_ERR_DOT_SOURCE: if(*FB < 0.51) *FB = 0.51; if(*FB > 0.99) *FB = 0.99; break; case INV_DISPLAY_ERR_DOT_DEST: if(*FB < 0.01) *FB = 0.01; if(*FB > 0.49) *FB = 0.49; break; } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/knob-img_large.xpm0000664000175000017500000004477611251515772025427 0ustar alessioalessio/* XPM */ static char * knob_img_large_xpm[] = { "62 62 684 2", " c None", ". c #ABA39A", "+ c #A29B95", "@ c #AEA59D", "# c #B0A79F", "$ c #989087", "% c #AFA7A0", "& c #A79E95", "* c #A89F96", "= c #A19891", "- c #9C938B", "; c #908881", "> c #958C85", ", c #8C847D", "' c #817772", ") c #C2B8B1", "! c #B9AFA8", "~ c #B2A8A0", "{ c #ADA59D", "] c #A89F97", "^ c #9A928A", "/ c #968D86", "( c #958D84", "_ c #A9A099", ": c #A9A098", "< c #AAA198", "[ c #A69D93", "} c #A29A92", "| c #A29990", "1 c #958C84", "2 c #928A82", "3 c #7C756F", "4 c #6E6661", "5 c #C9C1B8", "6 c #BDB4AC", "7 c #B5ACA4", "8 c #ADA49C", "9 c #A59C93", "0 c #A09890", "a c #948B84", "b c #9D958D", "c c #A29A91", "d c #A59C94", "e c #A0988F", "f c #A49C93", "g c #A49B92", "h c #9E968E", "i c #A19991", "j c #A39A92", "k c #9B928A", "l c #8C847E", "m c #7D756F", "n c #C5BCB5", "o c #C3BAB2", "p c #B3AAA2", "q c #AEA59C", "r c #ACA49B", "s c #9F978F", "t c #958D85", "u c #9B938B", "v c #A59C92", "w c #A79F96", "x c #A79F95", "y c #A79E94", "z c #A69D95", "A c #A0978F", "B c #9E958B", "C c #988F86", "D c #A19890", "E c #9A9189", "F c #9A918A", "G c #8B837B", "H c #837B74", "I c #918981", "J c #7E7570", "K c #DDD6CD", "L c #D3CDC5", "M c #B5ADA5", "N c #ABA29A", "O c #ACA39B", "P c #ACA29A", "Q c #A49B93", "R c #9F968F", "S c #A79E97", "T c #ABA39B", "U c #ABA299", "V c #AFA69E", "W c #9D948C", "X c #A1988F", "Y c #A79E96", "Z c #9D948B", "` c #9E958D", " . c #928981", ".. c #968D85", "+. c #8D847D", "@. c #918982", "#. c #9C938A", "$. c #8F867E", "%. c #827A73", "&. c #878078", "*. c #C4BBB3", "=. c #C7BDB5", "-. c #B6AEA6", ";. c #9F968E", ">. c #AAA299", ",. c #A89E97", "'. c #9D958C", "). c #978E85", "!. c #9A9188", "~. c #8F867F", "{. c #9A9289", "]. c #968E85", "^. c #978E86", "/. c #7B736C", "(. c #E3DDD6", "_. c #CFC7BE", ":. c #C0B7AE", "<. c #B4ACA4", "[. c #ACA39A", "}. c #A59D95", "|. c #ACA49C", "1. c #B1A89F", "2. c #AEA59B", "3. c #A69E95", "4. c #9C948C", "5. c #A39B93", "6. c #A19990", "7. c #A0978E", "8. c #99918A", "9. c #988F87", "0. c #999088", "a. c #999188", "b. c #9B9289", "c. c #928982", "d. c #A8A097", "e. c #978F86", "f. c #867D77", "g. c #7A726C", "h. c #E5E1DA", "i. c #CFC7BF", "j. c #B9B0A8", "k. c #B2A9A0", "l. c #A39A93", "m. c #B4ABA2", "n. c #AAA199", "o. c #A9A198", "p. c #B1A9A0", "q. c #A29991", "r. c #A49C94", "s. c #A49B94", "t. c #A39B92", "u. c #A39A91", "v. c #9F978E", "w. c #A2998F", "x. c #999087", "y. c #999089", "z. c #9E958C", "A. c #948B83", "B. c #857D75", "C. c #E1DED6", "D. c #C9C3BB", "E. c #B5ACA3", "F. c #ABA199", "G. c #A29A90", "H. c #A29992", "I. c #9C948D", "J. c #B1A8A0", "K. c #AEA69E", "L. c #9C938C", "M. c #A39B91", "N. c #9F968D", "O. c #A09790", "P. c #A1978F", "Q. c #918880", "R. c #8E867F", "S. c #898078", "T. c #807871", "U. c #C6BCB5", "V. c #BFB7AF", "W. c #B9B0A7", "X. c #B8AFA6", "Y. c #B0A79E", "Z. c #B3ABA3", "`. c #AEA59E", " + c #B2A9A1", ".+ c #A9A097", "++ c #AAA197", "@+ c #A59D94", "#+ c #8F877F", "$+ c #948C85", "%+ c #7C746E", "&+ c #E8E7E1", "*+ c #CCC4BB", "=+ c #B8B0A7", "-+ c #A9A199", ";+ c #AAA29A", ">+ c #BCB3AB", ",+ c #B4ACA3", "'+ c #B7AEA6", ")+ c #A69E96", "!+ c #A49C95", "~+ c #AEA69D", "{+ c #9B938A", "]+ c #938A83", "^+ c #A79D95", "/+ c #988F88", "(+ c #8A817B", "_+ c #EBE9E5", ":+ c #C5BEB7", "<+ c #B0A8A0", "[+ c #B7AEA7", "}+ c #BDB4AB", "|+ c #BCB3A9", "1+ c #BEB6AD", "2+ c #AFA79F", "3+ c #9E968D", "4+ c #A29890", "5+ c #908880", "6+ c #635C55", "7+ c #C5BDB4", "8+ c #B4ABA3", "9+ c #BFB6AE", "0+ c #C2B9B0", "a+ c #BBB2A9", "b+ c #C6BDB4", "c+ c #BFB6AD", "d+ c #A79F97", "e+ c #A39A90", "f+ c #A69D94", "g+ c #A89E96", "h+ c #9C948B", "i+ c #978E87", "j+ c #827972", "k+ c #CEC8C1", "l+ c #BCB3AC", "m+ c #BCB3AA", "n+ c #C0B7B0", "o+ c #C1B8B0", "p+ c #BDB5AD", "q+ c #ADA59C", "r+ c #9A928B", "s+ c #938B83", "t+ c #908780", "u+ c #7E766F", "v+ c #F1EFEC", "w+ c #D0C8C1", "x+ c #C8BFB7", "y+ c #C5BCB3", "z+ c #BDB4AE", "A+ c #B6ADA4", "B+ c #B8B0A8", "C+ c #B6ADA5", "D+ c #ABA399", "E+ c #A69D96", "F+ c #989088", "G+ c #8B827C", "H+ c #8F8780", "I+ c #716962", "J+ c #D1CAC4", "K+ c #CCC4BC", "L+ c #CAC1B8", "M+ c #C8BFB6", "N+ c #C2B9B1", "O+ c #BBB2A8", "P+ c #B1A9A1", "Q+ c #B8AFA7", "R+ c #9E958E", "S+ c #B7AEA5", "T+ c #B1A7A0", "U+ c #998F85", "V+ c #877F77", "W+ c #E2DFD8", "X+ c #D0C8BF", "Y+ c #C9C0B7", "Z+ c #C9C0B8", "`+ c #C3BAB1", " @ c #BCB2A9", ".@ c #BEB5AD", "+@ c #BCB2AA", "@@ c #AFA69D", "#@ c #B2A9A2", "$@ c #A8A098", "%@ c #ABA29B", "&@ c #A49B91", "*@ c #9F968C", "=@ c #938B84", "-@ c #978D84", ";@ c #C0B8AF", ">@ c #BEB5AC", ",@ c #C3B9B1", "'@ c #BAB1A9", ")@ c #BBB2AA", "!@ c #B3AAA1", "~@ c #B7AFA7", "{@ c #B3ABA2", "]@ c #ADA49D", "^@ c #AFA79E", "/@ c #A59D93", "(@ c #948B82", "_@ c #A39990", ":@ c #968D84", "<@ c #968E86", "[@ c #8D857D", "}@ c #E0DBD3", "|@ c #CCC3BB", "1@ c #C3BBB2", "2@ c #B9B1A9", "3@ c #C5BCB4", "4@ c #B0A89F", "5@ c #ADA49B", "6@ c #938A81", "7@ c #958C83", "8@ c #938B82", "9@ c #8A817A", "0@ c #746D66", "a@ c #D1C9C0", "b@ c #B7AFA6", "c@ c #BAB2A9", "d@ c #B2AAA2", "e@ c #B6ACA4", "f@ c #ACA299", "g@ c #AAA298", "h@ c #9B9189", "i@ c #A1988E", "j@ c #9C928A", "k@ c #918980", "l@ c #938A82", "m@ c #8E867E", "n@ c #D8D0C8", "o@ c #CAC1B9", "p@ c #C4BCB3", "q@ c #C0B7AF", "r@ c #C6BDB5", "s@ c #C4BBB2", "t@ c #B3ABA4", "u@ c #B6ACA3", "v@ c #AFA59C", "w@ c #9E948C", "x@ c #998F88", "y@ c #A39991", "z@ c #8C837B", "A@ c #989086", "B@ c #7A726B", "C@ c #8E8781", "D@ c #D3CBC2", "E@ c #C7BEB6", "F@ c #CDC4BB", "G@ c #AFA69F", "H@ c #ADA59E", "I@ c #B0A79D", "J@ c #B2A89F", "K@ c #ADA39A", "L@ c #AFA59D", "M@ c #B4ABA1", "N@ c #B4ACA2", "O@ c #B8AEA6", "P@ c #AEA49B", "Q@ c #A1978E", "R@ c #877E76", "S@ c #807771", "T@ c #948C84", "U@ c #756D67", "V@ c #D0C7BF", "W@ c #C5BBB4", "X@ c #C6BEB6", "Y@ c #B4ACA5", "Z@ c #B9B1AA", "`@ c #BAB0A6", " # c #B5ABA2", ".# c #BEB4AB", "+# c #BBB3AA", "@# c #B1A89E", "## c #9F958D", "$# c #A49A91", "%# c #91887F", "&# c #8E857D", "*# c #D6CFC7", "=# c #CBC2B9", "-# c #C8BEB6", ";# c #BEB6AE", "># c #B5ACA5", ",# c #B9B0A9", "'# c #BAB1A8", ")# c #9A9187", "!# c #9A9088", "~# c #8D847C", "{# c #D1C9C1", "]# c #C9C1BA", "^# c #C8C0B8", "/# c #C2BAB1", "(# c #C1B9B1", "_# c #ADA59B", ":# c #9B928B", "<# c #A59B93", "[# c #948C82", "}# c #928980", "|# c #847B74", "1# c #635B55", "2# c #CBC2BA", "3# c #CAC2B9", "4# c #B6AEA5", "5# c #BAB1A7", "6# c #A59B92", "7# c #9D948A", "8# c #9F958C", "9# c #7F766F", "0# c #8A827B", "a# c #807872", "b# c #CEC6BE", "c# c #CAC1BA", "d# c #B8AFA8", "e# c #BBB3AB", "f# c #ACA39C", "g# c #AAA098", "h# c #ABA297", "i# c #90877E", "j# c #867E76", "k# c #887F78", "l# c #C7BEB5", "m# c #C6BDB6", "n# c #C0B6AE", "o# c #ABA198", "p# c #9B9288", "q# c #958B83", "r# c #837B73", "s# c #847B72", "t# c #D0C7BE", "u# c #CEC6BD", "v# c #CFC6BD", "w# c #B5ADA4", "x# c #B9AFA7", "y# c #AEA49C", "z# c #ADA39B", "A# c #A79D94", "B# c #A99F96", "C# c #9C948A", "D# c #8B837C", "E# c #857D76", "F# c #D8D0C7", "G# c #CCC3BA", "H# c #BAB1AA", "I# c #B1A99F", "J# c #B4AAA2", "K# c #B0A69E", "L# c #978F87", "M# c #998F87", "N# c #7A716B", "O# c #D2CAC1", "P# c #BEB4AC", "Q# c #BAB2AA", "R# c #BBB1A9", "S# c #928881", "T# c #9A9087", "U# c #90877F", "V# c #847C74", "W# c #DBD5CD", "X# c #D5CCC4", "Y# c #C0B8B0", "Z# c #BBB1A8", "`# c #B1A79E", " $ c #8C847C", ".$ c #D3CCC3", "+$ c #D2CAC2", "@$ c #D3CAC2", "#$ c #BDB3AB", "$$ c #C1B8AF", "%$ c #B2A99F", "&$ c #B8AFA5", "*$ c #ACA399", "=$ c #A2988F", "-$ c #A0968D", ";$ c #8E857C", ">$ c #776F68", ",$ c #D5CEC5", "'$ c #D2C9C1", ")$ c #C6BEB5", "!$ c #C3B9B0", "~$ c #C1B8AE", "{$ c #BBB2AB", "]$ c #AAA19A", "^$ c #8B827A", "/$ c #716963", "($ c #D7D1C9", "_$ c #CBC3BB", ":$ c #C9C1B9", "<$ c #C7BFB7", "[$ c #CDC4BC", "}$ c #BDB4AA", "|$ c #B3A9A0", "1$ c #BAB0A8", "2$ c #A1978D", "3$ c #8B837A", "4$ c #7C736C", "5$ c #D0C9C0", "6$ c #CAC2BA", "7$ c #CFC6BE", "8$ c #C1B7AF", "9$ c #A0968E", "0$ c #C2B8AF", "a$ c #9292C7", "b$ c #C2BAB5", "c$ c #C7BDB4", "d$ c #B0A69D", "e$ c #988E86", "f$ c #7F776F", "g$ c #DDD6CE", "h$ c #CEC5BD", "i$ c #C4BCB4", "j$ c #A29EBE", "k$ c #3243ED", "l$ c #001AFF", "m$ c #636BD9", "n$ c #BCB4AC", "o$ c #C6BCB4", "p$ c #B5ABA3", "q$ c #B9AFA6", "r$ c #958D83", "s$ c #978D85", "t$ c #5E5751", "u$ c #D1CAC1", "v$ c #C5BDB5", "w$ c #C2B9B2", "x$ c #B7AFB3", "y$ c #5660DB", "z$ c #041DFE", "A$ c #172BEF", "B$ c #C6BFB7", "C$ c #C2B8B0", "D$ c #BAB0A7", "E$ c #A89F95", "F$ c #79716A", "G$ c #CBC3BA", "H$ c #C3BBB3", "I$ c #7C7FCB", "J$ c #142AF7", "K$ c #001AFE", "L$ c #3644D7", "M$ c #AEAABD", "N$ c #C5BBB2", "O$ c #ACA398", "P$ c #AAA097", "Q$ c #9D938C", "R$ c #9D948D", "S$ c #948C83", "T$ c #8E867D", "U$ c #7F7770", "V$ c #D2CBC3", "W$ c #CBC2B8", "X$ c #A3A0C0", "Y$ c #3041EB", "Z$ c #1329F3", "`$ c #8183C3", " % c #C1B9B0", ".% c #B3AAA3", "+% c #B8AEA5", "@% c #A69C93", "#% c #726C67", "$% c #DDD7CD", "%% c #BFB6AF", "&% c #C0B7AD", "*% c #BCB4B8", "=% c #5B64DE", "-% c #031CFD", ";% c #5761DC", ">% c #BDB6B8", ",% c #B9B1A8", "'% c #B4AAA1", ")% c #9D938A", "!% c #A9A096", "~% c #A49A92", "{% c #5B5451", "]% c #D7D0C7", "^% c #D0C8C0", "/% c #7F82CC", "(% c #152AF7", "_% c #3142EC", ":% c #A9A6C7", "<% c #D8D2C9", "[% c #CBC2BB", "}% c #C2BAB2", "|% c #A7A3C2", "1% c #3444ED", "2% c #142AF8", "3% c #8285D1", "4% c #B6ACA2", "5% c #B9B0A6", "6% c #6B645F", "7% c #BFB8BD", "8% c #5D66E0", "9% c #041DFD", "0% c #5C66E2", "a% c #CAC5CA", "b% c #ACA29B", "c% c #A69C94", "d% c #A29891", "e% c #9B9389", "f% c #A39DA7", "g% c #8588D5", "h% c #162BF7", "i% c #3343EF", "j% c #ACA9CA", "k% c #B7ADA5", "l% c #BDB3AA", "m% c #999189", "n% c #8C837C", "o% c #817972", "p% c #766F69", "q% c #041DF6", "r% c #152BF9", "s% c #8589D6", "t% c #8F857E", "u% c #877E77", "v% c #1C2BCB", "w% c #081FF7", "x% c #6773F3", "y% c #D2CFD6", "z% c #C1B7AE", "A% c #AFA59B", "B% c #877F78", "C% c #483F3B", "D% c #C5C3D2", "E% c #E4E0DC", "F% c #CBC1B9", "G% c #928A81", "H% c #746C66", "I% c #C8C1B9", "J% c #C7BFB6", "K% c #CEC5BC", "L% c #ADA49A", "M% c #A49C92", "N% c #D5CDC5", "O% c #D4CCC2", "P% c #D0C9C1", "Q% c #C5BBB3", "R% c #C4BAB1", "S% c #A0978D", "T% c #7D756E", "U% c #5D5750", "V% c #D9D3C9", "W% c #B2AAA1", "X% c #A89E94", "Y% c #817871", "Z% c #564F4B", "`% c #D5CDC4", " & c #CEC7BF", ".& c #C8C0B7", "+& c #898179", "@& c #514A47", "#& c #C8BEB7", "$& c #CDC5BC", "%& c #D1C8BF", "&& c #BDB5AC", "*& c #6E6560", "=& c #E7E4DD", "-& c #A9A095", ";& c #403934", ">& c #E3DDD5", ",& c #C0B8AE", "'& c #B2A99E", ")& c #776F69", "!& c #3F3836", "~& c #B7AEA4", "{& c #B3A9A1", "]& c #888079", "^& c #6A625C", "/& c #C9C3B9", "(& c #C5BDB6", "_& c #BFB5AE", ":& c #BFB5AD", "<& c #B8AEA4", "[& c #786F69", "}& c #49433E", "|& c #BEB5AB", "1& c #716964", "2& c #514A46", "3& c #6B635F", "4& c #4F4843", "5& c #BDB4AD", "6& c #AFA59E", "7& c #837A74", "8& c #4F4745", "9& c #88807A", "0& c #A39A94", "a& c #514A45", " . + @ # $ % & * = - ; > , ' ", " ) ! ~ { # ] ^ / ( _ : < [ } ] | & 1 2 , 3 4 ", " 5 6 7 8 9 & 0 a b c 9 d ] e c f g e h i j * k a l m ", " n o p q r & s t u v ] w x y z f A B C s D r : E F E G H I J ", " K L M N O P Q A R A S T U O V y = 0 W W X Y z Z i ` ...+.@.#.$.%.&. ", " *.=.-.] q N X i ;.A ] y q >.] ,.D '.W v q < | C ^ ).$ !.~.{.].2 ^.A - /. ", " (._.:.<.# [.: }.Y d |.. U 1.2.3.u - 4.5.6.9 7.8.9.0.a.D k ` e b.c.4.d.7.e.t f.g. ", " h.i.j.k.] - } l.] m.k.n.o.p.] q.r.i s.r.t.0 W - - A u.v.w.| k x.y.Q D a.k z.y.A.B.m ", " C.D.E.F.G.H.I.J.E.j.n.7 : { s.K.: : N . * c t.9 L.: M.e 7.` N.D | * d z.z.O.P.Q.R.1 S.T. ", " U.V.E.3.A i z W.X.Y.Z.Z.N i `. +] |.: O d.e t.- Y .+0 ;.#.k - - j | c ++b.@+N.#+$+..1 k ^.%+ ", " &+*+=+-+j ;+7 >+1.,+7 '+)+!+~+] z A O 3.^ 0 {+s : t.s.Q j Q ]+` t.D ^+q.W * A.y./+z.F 9.E x.R.(+ ", " _+:+<+N `.[+}+|+}+1+<.O R 2+# >.0 3+_ h 0 u ^ T f ;.9 4+j W A .+j | u.W 8 7.^.` v.N.A.x.C I .Z 5+6+ ", " 7+'+@ 8+9+0+a+b+c+1.@ |.d+] & A >.A 0 } i q.} O 9 e+Q u.f+8 .+& & = g+& z.j D ` E W h+> i+F ( F C j+ ", " k+V.l+6 6 m+n+o+p+@ ;+<+T . 0 U q+d.D r+r.3.< & i ;.q.c J.z w.g | z ++h+;.z * 3+W y w.9.W E C s+, .t+u+ ", " v+w+x+y+o+9+o z+A+8+m.p B+7 ;+C+D+u.0 !+j * < .+s.j Q k.p.E+Q } h N W {+A 9 X F+& j C E b.A y.G+t+H+, ` b.I+ ", " J+K+L+:.M+N+a+W.O+P+X.6 Q+m+[.[.3.n.o.z : Y & R+D r S+w : n.'.T+] k 3+: z W q.f+b.b.t.7.C A.5+2 1 $ u.N.U+V+ ", " W+X+x+Y+Z+`+ @.@p >+j.6 +@ +2+J. +E.@ @@8+* s '.8 #@$@9 * * %@p.{.N.&@O z.f+.+*@b t.z Y b.=@/ E D b {+!.A.-@C /. ", " X+Z+7+o+;@>@W.>+,@'@)@!@@@~@ +{@!@V # !@U u.E+]@U .+^@: 5.^@Q z.z < @+$@f+.+/@9 u.7.!.(@` ;._@N.!.2 :@^.<@(@x.[@ ", " }@|@1@.@2@>@>@3@)@>+>+1.k.8+'+r r 4@J.# 5@q m.1.* k.@ ++P+)+s u.N n..+U < .+9 * j z.6@R & | u.#.7@..!.8@A.1 7@$.9@0@ ", " a@M+'@0+.@*.:.'@=.a+M b@c@>+V * n.d@# [.7 C+e@O V : q [.g $@{ d@f@* q q g@d.q g h@W & & g j W i@` 1 1 j@k@;.9.9.l@m@ ", " n@o@p@o V.q@m+r@s@p+.@q@>+7 7 w ] @ @ t@~@ +E.u@Y.f+q+3.O . C+!@5@v@!@U 2.1.< w@x@y@- ` 9 Q ` z.(@z@A@!.).e.!.- i@:@B@C@ ", " D@E@6 o+C+2@F@1@.@o+:.p G@# _ { +H@j.A+J.I@S+J@K@U L@q+M@N@'+O@j.5@P@5@Y.d Q@Z - ` X D Q u.^.( !.u.9.6@0.E e b.R@S@T@U@ ", " V@Z+`+o+Z+Y+W@0+X@q@6 C+J.]@7 d.Y@Z@E. +`@X. #@@Y q E.a+.#9++#@@n.1.@#w ##Q - ;.6.j 7.u.z.l@b $#X a l@%#N.| A.m@:@:@m@&# ", " *#=#r@r@-#3@x+`+;#7 7 >#,#'@Z.'+'@M # m+E.5@& .+m.p '#X.S+q ] V #P N.Y D ` j ;.u.f+< W ).f+w.F+).x.` u.^.)#C 1 x.z.!#~# ", "{#]#^#/#7+L+E@s@b@}+'+'+W.m+(#.@<.>+a+A+_#r z Y.p '+5@E.4@] 8 +@@u.n.& :#z u.U w @ f+k <#.+h+` D [#| X ).!.X - Z A.}#7@|#1#", "X+*+;@Z+2#=.r@9+8+.@y+W.*.3#C+C+9+4#[..+: # '@# W.C+5#L@n.p 7 g ;.k.E+[.&@* l..+.+D D U ] k f {+k X E g * 9 6#*@7#8#~#9#0#a#", "b#r@Z+c#E@`+>+c+/#N+6 o s@m.W.'@@@9 f p >@ +[.d#>+q < p e# #z.f#] V J.!@Y.g#V & | n.k.X q.c D < 7.A h#g .+f+7#;.x.i#j#k#}#9#", "K+*+K+|@r@b+l#m#'@.@n#>+6 6 4#k.] q c+'@@ {@S+@@] V :.j.| 9 Y.8 @@m.8+5@o#U * ] ~ < g g f : & b .+.+* * p##.N.q#i+Q.1 .r#s#", "t#u#b#v#o@Z+`+)@q@}+'#>@w#8+q o.Q+>@2@<+p x#5@[.C+c+!@z 1.Y.'#a+C+k.y#z#n.q.q 9 D A#u.9 8 Y N & 7.B#f+C#| E #.d x.6@A.D#$.E#", "F#F@Z+_.G#o >+9+m.a+.@'+q 8 8+)@H#7 C+P@I#~+J#W.q N 4@: @ p '+7 8+P+E.* Y.K#u.^+@ 8 1.z O O c .+g z.{.L#` | ` M# .5+8@#+l@N#", "*#{#O#u#/#E@P#'+9+j.m.J.m+*.)@Q#C+ +X.V # m+p g#J.P@V V C+M@J.C+R#X.Y.7 @ u.8 1.p 1.f@# A d n.- S#!.` N.T#8#N.:@^.a ].( U#V#", "W#X#u#3#p@'#0+l#c@c+N+r@o+Y#'# +C+7 S+6 '+T Y.U ^@A+7 '#5@`.'+Y.!@A+Z#Y U 1.m.`#U [.] D 5@l.k ;.5+W f+).7.D a.R+#.e.5+ $7@j+", ".$+$@$o+#$=#p@E.s@9+o $$)@^@p.,+p ,+<.8 ] L@`.+@X.x#!@q {@m.8 x#! G@!@A+M@%$&$*$Y X +.+b g :#e 9 _@=$++` N.-$( k@;$b.!.9@>$", ",$'$E@x+)$!$~$0+9+*.>@Q+<.{$C+7 <.# p '+]$9+o+1+a+p J.m.N 7 E.@ Y.X.E.Q+1.q @ 6.t.T ] 9 A :#Y ;.Z q | X 7.C 7@$.9.i@C ^$9@/$", "($_$:$$$<$[$|@=#y+.@'@'#7 4#9+m.j.}$<+>+m+$$m+C+p e#. !@m+|$q O@R#'#1$J.@@f+@+O N ^+5.s #.w.#.z : ;.t.A #.:##.N.2$l@3$G 4$/.", "5$2#o@6$Y+7$Z+b+8$)@Q+>+l#>+7 }+^@=+o c+o+)@'@'@m.5@}+X.U `#:.$$}+k.q 5@8 q J.] g f+Z D *@o.z 9$;+A 0...W [.Z N.6@2 t+z@(@G ", ",$'$[$Z+*+*.$$o *..@7$)$'+C+P+Y@p@0$N+a$b$W.+@Z.)@8+E.N '#`+c$C+K@v@d$A+1.[.D _@g N.X N d #.* f+#.e.b.u.Q | ).> D e$U#..:@f$", "g$h$i.o@o p@i$o+6 x+)@:.4@Y >+o+o+j$k$l$m$n$}+>@R# +X.c+o$p p$X.m.1.q$m.K@u.f+f u.e Y D Q n.g 7#].u.7.h@Z 6@k E r$E x.s$^$t$", " u$v$i$)$9+c@o+E@1+E.]$C+w$X+x$y$z$l$l$A$B$o+7 1.C$`+c+m.j.p D$m+}+K@U * o.E$.+o#< X f@* =$x.W G.Z 0.^.(@b.b.A q.X E 7@F$ ", " Z+G$H$E@l#0+N+;@$@Q+/#2#X@I$J$l$l$K$L$M$c+w#>@*.:.w#j.Q+A+D$N$)@O$A#@@|$8 [.q e+P$5@f+Q$- 9 R$!.- ;.D z.W u.& ;.-@S$T$U$ ", " V$x+Y+:$a+n 6 8 0+Y+W$X$Y$l$l$l$Z$`$ %.%S+>+s@.@H#6 p '+:.b+A+E..+Y.M@J@+%@@5@Y.U h I.q.9$Z - D 9 .+z.i@@%g 7#X 0.^. .#% ", " $%+$o@;@2#+#%%$$&%*%=%z$l$l$-%;%>%j.!@o+x+o j.o O@V j.`+k..@,%b@ #S+'#U * '%A+[.q.)+` Q@)%N.Q u.;.e+.+!%~%* f ` x.l@:@{% ", " ]%^%:$o@2#6 o+/%(%l$l$l$_%:%Y#}+>@y+E@>+9+o+'@Q+q@S+d N K#/#S+W.m.!%@@|$`#<#Y g u.N.6#u.< W A n.[.u.g X 8#'.A.9.9.T. ", " <%7+[%X@}%|%1%l$l$l$2%3%[%n#N+*.E@r@}+s@$$ @c+:.C+# 5@1.4%5%'#q U q 8+V F.O 9 7.| ;.B#Q 3+[.U & 3.o#e+)#a {+q.Z %#6% ", " O#=#7%8%9%l$l$z$0%a%o }+l#=#r@o x+M+0+}+y+9+E.b% +m.W.D$'#U F.7 # [.Y.< A @%i@w.c%d%d [ g g 5@g 7.T@e%e ` N...U$ ", " f%g%h%l$l$l$i%j%F@y+V@v#2#E@)$Z+s@.@.@:.,#'+k%%$l%A+S+5@& p |$8 V 1.u.5@!%N.O Y S * ++< 8 { z W m%f+u.&@u.n%o%p% ", " q%l$l$r%s%K+3#6$*+|@M+o@o@E@N+.@$$N+}+6 W.:.a+5%k.[.5@@@8 @@# v v@U u.8 d.< 5@K@# F.@@< u.- D A#y 6#9.t%7@u% ", " v%w%x%y%'$o@_$o@5 G$7$r@*.b+l#7+s@o+z%o+N+.@>+@@Y.{@. +p q B#A%N Y.k.: V S+ +5@ +8 Y ] g | * &@y@a }#C B%C% ", " D%E%b#E@E@[$E@o@:$b+5 F%[$2#9+j.m+C$>+9+X.^@'#m.@@,+p q I@K@@#+%q q !@M@* J@E.: q.u.3.m.z#f+W l@9.#.G%H% ", " I%b#h$x+_$J%*.x+K%=#K%H$O@'#q@$$>@1$*$7 >+>#$$c@k.S+!@L%X.'+J.X. #Y . '#o#[.Y u.g w q+Q #.| M%X {.B@ ", " N%O%b#P%7+5 b#7$G#l#1+W.c+Q%R%0+p +>@}+6 .@8+p @m.+%C+7 }+)@ +.+# A+< $@: [.q .+.+z t.f+S%q.9$T%U% ", " V%*#=#=#y+l#6$F@`+y+o+`+2#}+d@:.:.}+$$W.P#W.'@A+O@'+)@6 C+n.k.k.@@Y.|.Y Y.W%P$u.o.* & g X%j Y%Z% ", " `%'$Y+h$ &h$M+.&w$G$F@9+q@E@o$$$j.X.W.'#A+6 '+d#z%A+Y.S+Q+p < @ q & `#@@q.9 E$Y g P$f@_@+&@& ", " V@D@K+o@#&o@$&%&l#&&.&o x+`+D$'+>@1.X.X.C+o $$Y.7 '@!@z#k.N * >. +d E$^+f+* !%J..+& V#*& ", " =&b#|@_$v#G#q@`+0+s@Y+b+o+X.:.Q+'#j.;#N+)@p Q+X.|$Y.!@P$`#@ 7.N.P$| ] 8 |$-&& A#|#;& ", " >&O#2#*.,&o+3@0+N+b+9+:.X.+@*.m+}++@m.)@&&!@I@'+p$K@1.z g#%$)+d 2.'&# @%*$#.)&!& ", " ^%x+r@Z+Y+b+`+c+a+'#o$$$.@9+~&W.l%'+7 X.p 1.%$8 N {&V : U m.# [.&@&@]&^& ", " /&2#(&0+C$&%n$p@o _&7+)@j.o+)@X.:&a+A+m.8 O 5@`#*$q <&!@& d$v@G%[&}& ", " Y+0+0+C$Y+y+=.)$6 s@/#'#}$N+'@|&!@n.@ 8+q 8 m.C+q P F.0 1&2& ", " M+c+n *.o 7+(#+@z%}+'+,%,%d | 5@Y.Y @@'#~ P 2. $3&4& ", " m.j.p+5&W.5 0+M@x#8 ` 6&P+!@f@Q+p y.2 r#7&8& ", " 9&0&= s y@4+R+l.L#c.R.a#T.a& "}; invada-studio-plugins-lv2-1.2.0/plugingui/widgets/meter-phase.h0000664000175000017500000000350311251515772024366 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __PHASE_METER_H #define __PHASE_METER_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_PHASE_METER_DRAW_ALL 0 #define INV_PHASE_METER_DRAW_DATA 1 #define INV_PHASE_METER(obj) GTK_CHECK_CAST(obj, inv_phase_meter_get_type (), InvPhaseMeter) #define INV_PHASE_METER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_phase_meter_get_type(), InvPhaseMeterClass) #define INV_IS_PHASE_METER(obj) GTK_CHECK_TYPE(obj, inv_phase_meter_get_type()) typedef struct _InvPhaseMeter InvPhaseMeter; typedef struct _InvPhaseMeterClass InvPhaseMeterClass; struct _InvPhaseMeter { GtkWidget widget; gint bypass; float phase; struct colour mOff0,mOff30,mOff45,mOff60,mOff90; struct colour mOn0, mOn30, mOn45, mOn60, mOn90; /* delta */ gint font_size; }; struct _InvPhaseMeterClass { GtkWidgetClass parent_class; }; GtkType inv_phase_meter_get_type(void); GtkWidget * inv_phase_meter_new(); void inv_phase_meter_set_bypass(InvPhaseMeter *meter, gint num); void inv_phase_meter_set_phase(InvPhaseMeter *meter, float num); G_END_DECLS #endif /* __PHASE_METER_PHASE_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/switch-toggle.c0000664000175000017500000004165111251515772024735 0ustar alessioalessio/* This widget provides toggle switches (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "math.h" #include "string.h" #include "widgets.h" #include "switch-toggle.h" #include "switch-toggle-img_off.xpm" #include "switch-toggle-img_on.xpm" static void inv_switch_toggle_class_init(InvSwitchToggleClass *klass); static void inv_switch_toggle_init(InvSwitchToggle *switch_toggle); static void inv_switch_toggle_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_switch_toggle_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_switch_toggle_realize(GtkWidget *widget); static gboolean inv_switch_toggle_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_switch_toggle_paint(GtkWidget *widget, gint mode); static gboolean inv_switch_toggle_button_press_event (GtkWidget *widget, GdkEventButton *event); static gboolean inv_switch_toggle_button_release_event (GtkWidget *widget, GdkEventButton *event); static void inv_switch_toggle_destroy(GtkObject *object); GtkType inv_switch_toggle_get_type(void) { static GType inv_switch_toggle_type = 0; char *name; int i; if (!inv_switch_toggle_type) { static const GTypeInfo type_info = { sizeof(InvSwitchToggleClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_switch_toggle_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvSwitchToggle), 0, /* n_preallocs */ (GInstanceInitFunc)inv_switch_toggle_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvSwitchToggle-%p-%d",inv_switch_toggle_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_switch_toggle_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_switch_toggle_type; } void inv_switch_toggle_set_bypass(InvSwitchToggle *switch_toggle, gint num) { switch_toggle->bypass = num; } void inv_switch_toggle_toggle(InvSwitchToggle *switch_toggle) { if(switch_toggle->state == INV_SWITCH_TOGGLE_ON) { switch_toggle->state = INV_SWITCH_TOGGLE_OFF; switch_toggle->value = switch_toggle->off_value; } else { switch_toggle->state = INV_SWITCH_TOGGLE_ON; switch_toggle->value = switch_toggle->on_value; } if(GTK_WIDGET_REALIZED(switch_toggle)) inv_switch_toggle_paint(GTK_WIDGET(switch_toggle),INV_SWITCH_TOGGLE_DRAW_DATA); } float inv_switch_toggle_get_value(InvSwitchToggle *switch_toggle) { return switch_toggle->value; } void inv_switch_toggle_set_state(InvSwitchToggle *switch_toggle, gint state) { if(switch_toggle->state != state) { switch_toggle->state = state; switch(state) { case INV_SWITCH_TOGGLE_ON: switch_toggle->value = switch_toggle->on_value; break; case INV_SWITCH_TOGGLE_OFF: switch_toggle->value = switch_toggle->off_value; break; } if(GTK_WIDGET_REALIZED(switch_toggle)) inv_switch_toggle_paint(GTK_WIDGET(switch_toggle),INV_SWITCH_TOGGLE_DRAW_DATA); } } void inv_switch_toggle_set_value(InvSwitchToggle *switch_toggle, gint state, float value) { switch(state) { case INV_SWITCH_TOGGLE_ON: switch_toggle->on_value=value; break; case INV_SWITCH_TOGGLE_OFF: switch_toggle->off_value=value; break; } } void inv_switch_toggle_set_colour(InvSwitchToggle *switch_toggle, gint state, float R, float G, float B) { switch(state) { case INV_SWITCH_TOGGLE_ON: switch_toggle->on.R=R; switch_toggle->on.G=G; switch_toggle->on.B=B; break; case INV_SWITCH_TOGGLE_OFF: switch_toggle->off.R=R; switch_toggle->off.G=G; switch_toggle->off.B=B; break; } } void inv_switch_toggle_set_text(InvSwitchToggle *switch_toggle, gint state, const char *text) { switch(state) { case INV_SWITCH_TOGGLE_ON: strncpy(switch_toggle->on_text,text,14); break; case INV_SWITCH_TOGGLE_OFF: strncpy(switch_toggle->off_text,text,14); break; } } void inv_switch_toggle_set_label(InvSwitchToggle *switch_toggle, const char *text) { strncpy(switch_toggle->label,text,14); } void inv_switch_toggle_set_tooltip(InvSwitchToggle *switch_toggle, gchar *tip) { gtk_widget_set_tooltip_markup(GTK_WIDGET(switch_toggle),tip); } GtkWidget * inv_switch_toggle_new() { return GTK_WIDGET(gtk_type_new(inv_switch_toggle_get_type())); } static void inv_switch_toggle_class_init(InvSwitchToggleClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_switch_toggle_realize; widget_class->size_request = inv_switch_toggle_size_request; widget_class->size_allocate = inv_switch_toggle_size_allocate; widget_class->expose_event = inv_switch_toggle_expose; widget_class->button_press_event = inv_switch_toggle_button_press_event; widget_class->button_release_event = inv_switch_toggle_button_release_event; object_class->destroy = inv_switch_toggle_destroy; } static void inv_switch_toggle_init(InvSwitchToggle *switch_toggle) { switch_toggle->bypass = INV_PLUGIN_ACTIVE; switch_toggle->state = INV_SWITCH_TOGGLE_OFF; switch_toggle->laststate = INV_SWITCH_TOGGLE_OFF; switch_toggle->value=0; switch_toggle->on_value=1; switch_toggle->off_value=0; switch_toggle->on.R =0.0; switch_toggle->on.G =1.0; switch_toggle->on.B =0.0; switch_toggle->off.R =1.0; switch_toggle->off.G =0.0; switch_toggle->off.B =0.0; strcpy(switch_toggle->on_text,""); strcpy(switch_toggle->off_text,""); strcpy(switch_toggle->label,""); switch_toggle->img_on=gdk_pixbuf_new_from_xpm_data((const char **)switch_toggle_img_on_xpm); switch_toggle->img_off=gdk_pixbuf_new_from_xpm_data((const char **)switch_toggle_img_off_xpm); switch_toggle->font_size=0; GTK_WIDGET_SET_FLAGS (GTK_WIDGET(switch_toggle), GTK_CAN_FOCUS); } static void inv_switch_toggle_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_SWITCH_TOGGLE(widget)); g_return_if_fail(requisition != NULL); if(strlen(INV_SWITCH_TOGGLE(widget)->label)>0) { requisition->width = 76; } else { requisition->width = 64; } requisition->height = 66; } static void inv_switch_toggle_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_SWITCH_TOGGLE(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_switch_toggle_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_SWITCH_TOGGLE(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; if(strlen(INV_SWITCH_TOGGLE(widget)->label)>0) { attributes.width = 76; } else { attributes.width = 64; } attributes.height = 66; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_switch_toggle_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_SWITCH_TOGGLE(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_switch_toggle_paint(widget,INV_SWITCH_TOGGLE_DRAW_ALL); return FALSE; } static void inv_switch_toggle_paint(GtkWidget *widget, gint mode) { gint bypass; gint state; gint laststate; struct colour on,off; char *on_text; char *off_text; char *label; GdkPixbuf *img_on; GdkPixbuf *img_off; gint i; float indent,topdent,max,grey; char character[2]; cairo_t *cr; GtkStyle *style; cairo_text_extents_t extents; cairo_pattern_t *pat; style = gtk_widget_get_style(widget); bypass = INV_SWITCH_TOGGLE(widget)->bypass; state = INV_SWITCH_TOGGLE(widget)->state; laststate = INV_SWITCH_TOGGLE(widget)->laststate; if(bypass==INV_PLUGIN_BYPASS) { on.R = (INV_SWITCH_TOGGLE(widget)->on.R + INV_SWITCH_TOGGLE(widget)->on.G + INV_SWITCH_TOGGLE(widget)->on.B)/3; on.G = on.R; on.B = on.R; off.R = (INV_SWITCH_TOGGLE(widget)->off.R + INV_SWITCH_TOGGLE(widget)->off.G + INV_SWITCH_TOGGLE(widget)->off.B)/3; off.G = off.R; off.B = off.R; } else { on.R = INV_SWITCH_TOGGLE(widget)->on.R; on.G = INV_SWITCH_TOGGLE(widget)->on.G; on.B = INV_SWITCH_TOGGLE(widget)->on.B; off.R = INV_SWITCH_TOGGLE(widget)->off.R; off.G = INV_SWITCH_TOGGLE(widget)->off.G; off.B = INV_SWITCH_TOGGLE(widget)->off.B; } on_text = INV_SWITCH_TOGGLE(widget)->on_text; off_text = INV_SWITCH_TOGGLE(widget)->off_text; label = INV_SWITCH_TOGGLE(widget)->label; img_on = INV_SWITCH_TOGGLE(widget)->img_on; img_off = INV_SWITCH_TOGGLE(widget)->img_off; cr = gdk_cairo_create(widget->window); if(INV_SWITCH_TOGGLE(widget)->font_size==0) { INV_SWITCH_TOGGLE(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,7.1,7.1,"O"); } indent = strlen(label)>0 ? 12.0 : 0.0; if(mode==INV_SWITCH_TOGGLE_DRAW_ALL) { gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]); cairo_paint(cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); cairo_move_to(cr, indent, 13); cairo_line_to(cr, 63+indent, 13); cairo_line_to(cr, 63+indent, 0); cairo_move_to(cr, indent, 65); cairo_line_to(cr, 63+indent, 65); cairo_line_to(cr, 63+indent, 52); cairo_stroke(cr); gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); cairo_move_to(cr, indent, 13); cairo_line_to(cr, indent, 0); cairo_line_to(cr, 63+indent, 0); cairo_move_to(cr, indent, 65); cairo_line_to(cr, indent, 52); cairo_line_to(cr, 63+indent, 52); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_new_path(cr); if(strlen(label)>0) { if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE); cairo_set_line_width(cr,1); cairo_rectangle(cr, 0, 1, 10, 64); cairo_stroke(cr); cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT); cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL); gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]); cairo_set_font_size(cr,INV_SWITCH_TOGGLE(widget)->font_size); topdent=42.0-(8.0*(float)(strlen(label))/2); for(i=0; ifont_size); if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) { gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]); } else { gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]); } switch(state) { case INV_SWITCH_TOGGLE_ON: max = off.R > off.G ? off.R : off.G; max = off.B > max ? off.B : max; grey=max/3; cairo_set_source_rgb(cr, grey/3, grey/3, grey/3); cairo_rectangle(cr, 1+indent, 1, 62, 13); cairo_fill(cr); cairo_set_source_rgb(cr, grey, grey, grey); cairo_text_extents (cr,off_text,&extents); cairo_move_to(cr,31+indent-(extents.width/2), 11); cairo_show_text(cr,off_text); pat = cairo_pattern_create_linear (indent, 0.0, 66.0+indent, 0.0); cairo_pattern_add_color_stop_rgba (pat, 0.0, on.R/6, on.G/6, on.B/6, 1); cairo_pattern_add_color_stop_rgba (pat, 0.3, on.R/3, on.G/3, on.B/3, 1); cairo_pattern_add_color_stop_rgba (pat, 0.5, on.R/2, on.G/2, on.B/2, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, on.R/3, on.G/3, on.B/3, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, on.R/6, on.G/6, on.B/6, 1); cairo_set_source (cr, pat); cairo_rectangle(cr, 1+indent, 53, 62, 13); cairo_fill(cr); cairo_set_source_rgb(cr, on.R, on.G, on.B); cairo_text_extents (cr,on_text,&extents); cairo_move_to(cr,31+indent-(extents.width/2), 63); cairo_show_text(cr,on_text); cairo_save(cr); cairo_arc(cr,32+indent,33.5,12,0,2*INV_PI); cairo_clip(cr); gdk_cairo_set_source_pixbuf(cr,img_on, 32+indent-12.5, 33.5-12.5); cairo_paint(cr); cairo_restore(cr); break; case INV_SWITCH_TOGGLE_OFF: pat = cairo_pattern_create_linear (indent, 0.0, 66.0+indent, 0.0); cairo_pattern_add_color_stop_rgba (pat, 0.0, off.R/6, off.G/6, off.B/6, 1); cairo_pattern_add_color_stop_rgba (pat, 0.3, off.R/3, off.G/3, off.B/3, 1); cairo_pattern_add_color_stop_rgba (pat, 0.5, off.R/2, off.G/2, off.B/2, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, off.R/3, off.G/3, off.B/3, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, off.R/6, off.G/6, off.B/6, 1); cairo_set_source (cr, pat); cairo_rectangle(cr, 1+indent, 1, 62, 13); cairo_fill(cr); cairo_set_source_rgb(cr, off.R, off.G, off.B); cairo_text_extents (cr,off_text,&extents); cairo_move_to(cr,31+indent-(extents.width/2), 11); cairo_show_text(cr,off_text); max = on.R > on.G ? on.R : on.G; max = on.B > max ? on.B : max; grey=max/3; cairo_set_source_rgb(cr, grey/3, grey/3, grey/3); cairo_rectangle(cr, 1+indent, 53, 62, 13); cairo_fill(cr); cairo_set_source_rgb(cr, grey, grey, grey); cairo_text_extents (cr,on_text,&extents); cairo_move_to(cr,31+indent-(extents.width)/2, 63); cairo_show_text(cr,on_text); cairo_save(cr); cairo_arc(cr,32+indent,33.5,12,0,2*INV_PI); cairo_clip(cr); gdk_cairo_set_source_pixbuf(cr,img_off, 32+indent-12.5, 33.5-12.5); cairo_paint(cr); cairo_restore(cr); break; } cairo_save(cr); cairo_move_to(cr,32+indent,50.5); for(i=1;i<=6;i++) { cairo_line_to(cr,32+indent+17*sin(i*INV_PI/3),33.5+17*cos(i*INV_PI/3)); } cairo_clip(cr); pat = cairo_pattern_create_linear (indent, 0.0, 66.0+indent, 64.0); cairo_pattern_add_color_stop_rgba (pat, 0.0, 1.00, 1.00, 1.00, 1); cairo_pattern_add_color_stop_rgba (pat, 0.32, 0.91, 0.89, 0.83, 1); cairo_pattern_add_color_stop_rgba (pat, 0.5, 0.43, 0.32, 0.26, 1); cairo_pattern_add_color_stop_rgba (pat, 0.68, 0.10, 0.05, 0.04, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.00, 0.00, 0.00, 1); cairo_set_source (cr, pat); cairo_set_line_width(cr,5); cairo_arc(cr,32+indent,33.5,14.5,0,2*INV_PI); cairo_stroke(cr); cairo_restore(cr); cairo_destroy(cr); } static gboolean inv_switch_toggle_button_press_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_SWITCH_TOGGLE(widget)); gtk_widget_set_state(widget,GTK_STATE_ACTIVE); gtk_widget_grab_focus(widget); inv_switch_toggle_paint(widget,INV_SWITCH_TOGGLE_DRAW_ALL); return TRUE; } static gboolean inv_switch_toggle_button_release_event (GtkWidget *widget, GdkEventButton *event) { g_assert(INV_IS_SWITCH_TOGGLE(widget)); gtk_widget_set_state(widget,GTK_STATE_NORMAL); inv_switch_toggle_toggle(INV_SWITCH_TOGGLE (widget)); //this will also paint the widget return FALSE; //let the signal in the gui run now } static void inv_switch_toggle_destroy(GtkObject *object) { InvSwitchToggle *switch_toggle; InvSwitchToggleClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_SWITCH_TOGGLE(object)); switch_toggle = INV_SWITCH_TOGGLE(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/switch-toggle.h0000664000175000017500000000515011251515772024734 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __SWITCH_TOGGLE_H #define __SWITCH_TOGGLE_H #include #include #include "widgets.h" G_BEGIN_DECLS #define INV_SWITCH_TOGGLE_DRAW_ALL 0 #define INV_SWITCH_TOGGLE_DRAW_DATA 1 #define INV_SWITCH_TOGGLE_OFF 0 #define INV_SWITCH_TOGGLE_ON 1 #define INV_SWITCH_TOGGLE(obj) GTK_CHECK_CAST(obj, inv_switch_toggle_get_type (), InvSwitchToggle) #define INV_SWITCH_TOGGLE_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, inv_switch_toggle_get_type(), InvSwitchToggleClass) #define INV_IS_SWITCH_TOGGLE(obj) GTK_CHECK_TYPE(obj, inv_switch_toggle_get_type()) typedef struct _InvSwitchToggle InvSwitchToggle; typedef struct _InvSwitchToggleClass InvSwitchToggleClass; struct _InvSwitchToggle { GtkWidget widget; gint bypass; gint state; gint laststate; float value; float on_value; float off_value; struct colour on; struct colour off; char on_text[15]; char off_text[15]; char label[15]; GdkPixbuf *img_on; GdkPixbuf *img_off; gint font_size; }; struct _InvSwitchToggleClass { GtkWidgetClass parent_class; }; GtkType inv_switch_toggle_get_type(void); GtkWidget * inv_switch_toggle_new(); void inv_switch_toggle_set_bypass(InvSwitchToggle *switch_toggle, gint num); void inv_switch_toggle_toggle(InvSwitchToggle *switch_toggle); void inv_switch_toggle_set_state(InvSwitchToggle *switch_toggle, gint state); void inv_switch_toggle_set_value(InvSwitchToggle *switch_toggle, gint state, float value); void inv_switch_toggle_set_colour(InvSwitchToggle *switch_toggle, gint state, float R, float G, float B); void inv_switch_toggle_set_text(InvSwitchToggle *switch_toggle, gint state, const char *text); void inv_switch_toggle_set_label(InvSwitchToggle *switch_toggle, const char *text); void inv_switch_toggle_set_tooltip(InvSwitchToggle *switch_toggle, gchar *tip); float inv_switch_toggle_get_value(InvSwitchToggle *switch_toggle); G_END_DECLS #endif /* __SWITCH_TOGGLE_H */ invada-studio-plugins-lv2-1.2.0/plugingui/widgets/lamp.c0000664000175000017500000002315711251515772023107 0ustar alessioalessio/* This widget provides lamps (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdlib.h" #include "string.h" #include "widgets.h" #include "lamp.h" static void inv_lamp_class_init(InvLampClass *klass); static void inv_lamp_init(InvLamp *lamp); static void inv_lamp_size_request(GtkWidget *widget, GtkRequisition *requisition); static void inv_lamp_size_allocate(GtkWidget *widget, GtkAllocation *allocation); static void inv_lamp_realize(GtkWidget *widget); static gboolean inv_lamp_expose(GtkWidget *widget,GdkEventExpose *event); static void inv_lamp_paint(GtkWidget *widget, gint mode); static void inv_lamp_destroy(GtkObject *object); static void inv_lamp_colour(GtkWidget *widget, float value, struct colour *rc, struct colour *cc); GtkType inv_lamp_get_type(void) { static GType inv_lamp_type = 0; char *name; int i; if (!inv_lamp_type) { static const GTypeInfo type_info = { sizeof(InvLampClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)inv_lamp_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InvLamp), 0, /* n_preallocs */ (GInstanceInitFunc)inv_lamp_init }; for (i = 0; ; i++) { name = g_strdup_printf("InvLamp-%p-%d",inv_lamp_class_init, i); if (g_type_from_name(name)) { free(name); continue; } inv_lamp_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0); free(name); break; } } return inv_lamp_type; } void inv_lamp_set_scale(InvLamp *lamp, float num) { lamp->scale = num; } void inv_lamp_set_value(InvLamp *lamp, float num) { lamp->value = num; if(lamp->value != lamp->lastValue) { if(GTK_WIDGET_REALIZED(lamp)) inv_lamp_paint(GTK_WIDGET(lamp),INV_LAMP_DRAW_DATA); } } void inv_lamp_set_tooltip(InvLamp *lamp, gchar *tip) { gtk_widget_set_tooltip_markup(GTK_WIDGET(lamp),tip); } GtkWidget * inv_lamp_new() { return GTK_WIDGET(gtk_type_new(inv_lamp_get_type())); } static void inv_lamp_class_init(InvLampClass *klass) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; widget_class = (GtkWidgetClass *) klass; object_class = (GtkObjectClass *) klass; widget_class->realize = inv_lamp_realize; widget_class->size_request = inv_lamp_size_request; widget_class->size_allocate = inv_lamp_size_allocate; widget_class->expose_event = inv_lamp_expose; object_class->destroy = inv_lamp_destroy; } static void inv_lamp_init(InvLamp *lamp) { lamp->scale = 1; lamp->value = 0; lamp->lastValue=0; lamp->l0_r.R =0.1; lamp->l0_r.G =0.0; lamp->l0_r.B =0.0; lamp->l0_c.R =0.2; lamp->l0_c.G =0.0; lamp->l0_c.B =0.0; lamp->l1_r.R =0.2; lamp->l1_r.G =0.0; lamp->l1_r.B =0.0; lamp->l1_c.R =1.0; lamp->l1_c.G =0.0; lamp->l1_c.B =0.0; lamp->l2_r.R =0.3; lamp->l2_r.G =0.0; lamp->l2_r.B =0.0; lamp->l2_c.R =1.0; lamp->l2_c.G =0.5; lamp->l2_c.B =0.0; lamp->l3_r.R =0.4; lamp->l3_r.G =0.0; lamp->l3_r.B =0.0; lamp->l3_c.R =1.0; lamp->l3_c.G =1.0; lamp->l3_c.B =0.0; lamp->l4_r.R =0.5; lamp->l4_r.G =0.0; lamp->l4_r.B =0.0; lamp->l4_c.R =1.0; lamp->l4_c.G =1.0; lamp->l4_c.B =0.5; } static void inv_lamp_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_LAMP(widget)); g_return_if_fail(requisition != NULL); requisition->width = 32; requisition->height = 32; } static void inv_lamp_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_LAMP(widget)); g_return_if_fail(allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { gdk_window_move_resize( widget->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static void inv_lamp_realize(GtkWidget *widget) { GdkWindowAttr attributes; guint attributes_mask; g_return_if_fail(widget != NULL); g_return_if_fail(INV_IS_LAMP(widget)); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = 32; attributes.height = 32; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y; widget->window = gdk_window_new( gtk_widget_get_parent_window (widget), & attributes, attributes_mask ); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); } static gboolean inv_lamp_expose(GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail(widget != NULL, FALSE); g_return_val_if_fail(INV_IS_LAMP(widget), FALSE); g_return_val_if_fail(event != NULL, FALSE); inv_lamp_paint(widget,INV_LAMP_DRAW_ALL); return FALSE; } static void inv_lamp_paint(GtkWidget *widget, gint mode) { cairo_t *cr; float xc,yc,r; struct colour rc,cc; GtkStyle *style; cairo_pattern_t *pat; style = gtk_widget_get_style(widget); float scale = INV_LAMP(widget)->scale; float value = INV_LAMP(widget)->value; cr = gdk_cairo_create(widget->window); xc=16.0; yc=16.0; r=9.5; switch(mode) { case INV_LAMP_DRAW_ALL: cairo_arc(cr,xc,yc,13,0,2*INV_PI); cairo_set_source_rgb(cr, 0, 0, 0); cairo_fill_preserve(cr); pat = cairo_pattern_create_linear (0.0, 0.0, 32.0, 32.0); cairo_pattern_add_color_stop_rgba (pat, 0.0, 1.00, 1.00, 1.00, 1); cairo_pattern_add_color_stop_rgba (pat, 0.2, 0.91, 0.89, 0.83, 1); cairo_pattern_add_color_stop_rgba (pat, 0.5, 0.43, 0.32, 0.26, 1); cairo_pattern_add_color_stop_rgba (pat, 0.8, 0.10, 0.05, 0.04, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.00, 0.00, 0.00, 1); cairo_set_source (cr, pat); cairo_set_line_width(cr,5); cairo_stroke(cr); case INV_LAMP_DRAW_DATA: pat = cairo_pattern_create_radial (xc-1, yc-1, 1.5, xc, yc, r); inv_lamp_colour(widget, value*scale, &rc, &cc); cairo_pattern_add_color_stop_rgba (pat, 0.0, cc.R, cc.G, cc.B, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, rc.R, rc.G, rc.B, 1); cairo_pattern_add_color_stop_rgba (pat, 0.9, 0.1, 0.0, 0.0, 1); cairo_pattern_add_color_stop_rgba (pat, 1.0, 0.1, 0.0, 0.0, 0); cairo_set_source (cr, pat); cairo_arc(cr,xc,yc,r,0,2*INV_PI); cairo_fill(cr); INV_LAMP(widget)->lastValue = value; break; } cairo_destroy(cr); } static void inv_lamp_destroy(GtkObject *object) { InvLamp *lamp; InvLampClass *klass; g_return_if_fail(object != NULL); g_return_if_fail(INV_IS_LAMP(object)); lamp = INV_LAMP(object); klass = gtk_type_class(gtk_widget_get_type()); if (GTK_OBJECT_CLASS(klass)->destroy) { (* GTK_OBJECT_CLASS(klass)->destroy) (object); } } static void inv_lamp_colour(GtkWidget *widget, float value, struct colour *rc, struct colour *cc) { float f1,f2; struct colour *r0; struct colour *c0; struct colour *r1; struct colour *c1; if(value <= 0) { rc->R=INV_LAMP(widget)->l0_r.R; rc->G=INV_LAMP(widget)->l0_r.G; rc->B=INV_LAMP(widget)->l0_r.B; cc->R=INV_LAMP(widget)->l0_c.R; cc->G=INV_LAMP(widget)->l0_c.G; cc->B=INV_LAMP(widget)->l0_c.B; } else if (value < 1) { r0=&(INV_LAMP(widget)->l0_r); c0=&(INV_LAMP(widget)->l0_c); r1=&(INV_LAMP(widget)->l1_r); c1=&(INV_LAMP(widget)->l1_c); f1=1-value; f2=value; rc->R=(f1 * r0->R) + (f2 * r1->R); rc->G=(f1 * r0->G) + (f2 * r1->G); rc->B=(f1 * r0->B) + (f2 * r1->B); cc->R=(f1 * c0->R) + (f2 * c1->R); cc->G=(f1 * c0->G) + (f2 * c1->G); cc->B=(f1 * c0->B) + (f2 * c1->B); } else if (value < 2) { r0=&(INV_LAMP(widget)->l1_r); c0=&(INV_LAMP(widget)->l1_c); r1=&(INV_LAMP(widget)->l2_r); c1=&(INV_LAMP(widget)->l2_c); f1=2-value; f2=value-1; rc->R=(f1 * r0->R) + (f2 * r1->R); rc->G=(f1 * r0->G) + (f2 * r1->G); rc->B=(f1 * r0->B) + (f2 * r1->B); cc->R=(f1 * c0->R) + (f2 * c1->R); cc->G=(f1 * c0->G) + (f2 * c1->G); cc->B=(f1 * c0->B) + (f2 * c1->B); } else if (value < 3) { r0=&(INV_LAMP(widget)->l2_r); c0=&(INV_LAMP(widget)->l2_c); r1=&(INV_LAMP(widget)->l3_r); c1=&(INV_LAMP(widget)->l3_c); f1=3-value; f2=value-2; rc->R=(f1 * r0->R) + (f2 * r1->R); rc->G=(f1 * r0->G) + (f2 * r1->G); rc->B=(f1 * r0->B) + (f2 * r1->B); cc->R=(f1 * c0->R) + (f2 * c1->R); cc->G=(f1 * c0->G) + (f2 * c1->G); cc->B=(f1 * c0->B) + (f2 * c1->B); } else if (value < 4) { r0=&(INV_LAMP(widget)->l3_r); c0=&(INV_LAMP(widget)->l3_c); r1=&(INV_LAMP(widget)->l4_r); c1=&(INV_LAMP(widget)->l4_c); f1=4-value; f2=value-3; rc->R=(f1 * r0->R) + (f2 * r1->R); rc->G=(f1 * r0->G) + (f2 * r1->G); rc->B=(f1 * r0->B) + (f2 * r1->B); cc->R=(f1 * c0->R) + (f2 * c1->R); cc->G=(f1 * c0->G) + (f2 * c1->G); cc->B=(f1 * c0->B) + (f2 * c1->B); } else { rc->R=INV_LAMP(widget)->l4_r.R; rc->G=INV_LAMP(widget)->l4_r.G; rc->B=INV_LAMP(widget)->l4_r.B; cc->R=INV_LAMP(widget)->l4_c.R; cc->G=INV_LAMP(widget)->l4_c.G; cc->B=INV_LAMP(widget)->l4_c.B; } } invada-studio-plugins-lv2-1.2.0/plugingui/widgets/Makefile0000664000175000017500000000365011251515772023446 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # GENERAL CC = gcc LD = ld CFLAGS = -I. `pkg-config --cflags gtk+-2.0` -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC all: libinv_widgets.a # RULES TO BUILD LIBRARIES FROM C CODE libinv_widgets.a: widgets.o widgets.h \ display-Compressor.o display-Compressor.h \ display-FrequencyGain.o display-FrequencyGain.h \ display-ErReverb.o display-ErReverb.h \ display-Spectrograph.o display-Spectrograph.h \ knob.o knob.h \ lamp.o lamp.h \ meter-peak.o meter-peak.h \ meter-phase.o meter-phase.h \ meter-vu.o meter-vu.h \ switch-toggle.o switch-toggle.h @echo "Creating libinv_widgets.a" @ar rcs libinv_widgets.a \ widgets.o \ display-Compressor.o \ display-ErReverb.o \ display-FrequencyGain.o \ display-Spectrograph.o \ knob.o \ lamp.o \ meter-peak.o \ meter-phase.o \ meter-vu.o \ switch-toggle.o # OTHER TARGETS targets: libinv_widgets.a always: clean: -rm -f *.a -rm -f *.o -rm -f *~ %.o: %.c @echo "Compiling $<" @$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ invada-studio-plugins-lv2-1.2.0/plugingui/inv_input_gui.h0000664000175000017500000000265011251515772023367 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_input_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_phaseL_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_phaseR_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_pan_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_input_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_filter_gui.c0000664000175000017500000004223411251515772023512 0ustar alessioalessio/* This LV2 extension provides lpf and hpf gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/display-FrequencyGain.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_filter.h" #include "inv_filter_gui.h" static LV2UI_Descriptor *IFilterGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *display; GtkWidget *knobFreq; GtkWidget *knobGain; GtkWidget *toggleNoClip; GtkWidget *lampNoClip; gint InChannels; gint OutChannels; float bypass; float freq; float gain; float noClip; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IFilterGui; static LV2UI_Handle instantiateIFilterGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IFilterGui *pluginGui = (IFilterGui *)malloc(sizeof(IFilterGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_filter_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "filter_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "filter_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_filter_display")); pluginGui->display = inv_display_fg_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->display); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_frequency_knob")); pluginGui->knobFreq = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobFreq); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_gain_knob")); pluginGui->knobGain = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobGain); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_toggle")); pluginGui->toggleNoClip = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleNoClip); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_lamp")); pluginGui->lampNoClip = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampNoClip); /* customise for the plugin */ if(!strcmp(plugin_uri,IFILTER_MONO_LPF_URI)) { pluginGui->InChannels=1; pluginGui->OutChannels=1; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Low Pass Filter (mono)"); inv_display_fg_set_mode(INV_DISPLAY_FG (pluginGui->display), INV_DISPLAYFG_MODE_LPF); inv_knob_set_highlight(INV_KNOB (pluginGui->knobFreq), INV_KNOB_HIGHLIGHT_R); } if(!strcmp(plugin_uri,IFILTER_MONO_HPF_URI)) { pluginGui->InChannels=1; pluginGui->OutChannels=1; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "High Pass Filter (mono)"); inv_display_fg_set_mode(INV_DISPLAY_FG (pluginGui->display), INV_DISPLAYFG_MODE_HPF); inv_knob_set_highlight(INV_KNOB (pluginGui->knobFreq), INV_KNOB_HIGHLIGHT_L); } if(!strcmp(plugin_uri,IFILTER_STEREO_LPF_URI)) { pluginGui->InChannels=2; pluginGui->OutChannels=2; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Low Pass Filter (stereo)"); inv_display_fg_set_mode(INV_DISPLAY_FG (pluginGui->display), INV_DISPLAYFG_MODE_LPF); inv_knob_set_highlight(INV_KNOB (pluginGui->knobFreq), INV_KNOB_HIGHLIGHT_R); } if(!strcmp(plugin_uri,IFILTER_STEREO_HPF_URI)) { pluginGui->InChannels=2; pluginGui->OutChannels=2; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "High Pass Filter (stereo)"); inv_display_fg_set_mode(INV_DISPLAY_FG (pluginGui->display), INV_DISPLAYFG_MODE_HPF); inv_knob_set_highlight(INV_KNOB (pluginGui->knobFreq), INV_KNOB_HIGHLIGHT_L); } pluginGui->bypass=0.0; pluginGui->freq=1000.0; pluginGui->gain=0.0; pluginGui->noClip=0.0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_filter_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_display_fg_set_bypass(INV_DISPLAY_FG (pluginGui->display), INV_PLUGIN_ACTIVE); inv_display_fg_set_freq(INV_DISPLAY_FG (pluginGui->display), pluginGui->freq); inv_display_fg_set_gain(INV_DISPLAY_FG (pluginGui->display), pluginGui->gain); g_signal_connect_after(G_OBJECT(pluginGui->display),"motion-notify-event",G_CALLBACK(on_inv_filter_display_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobFreq), INV_KNOB_SIZE_LARGE); inv_knob_set_curve(INV_KNOB (pluginGui->knobFreq), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobFreq), INV_KNOB_MARKINGS_4); inv_knob_set_human(INV_KNOB (pluginGui->knobFreq)); inv_knob_set_units(INV_KNOB (pluginGui->knobFreq), "Hz"); inv_knob_set_min(INV_KNOB (pluginGui->knobFreq), 20.0); inv_knob_set_max(INV_KNOB (pluginGui->knobFreq), 20000.0); inv_knob_set_value(INV_KNOB (pluginGui->knobFreq), pluginGui->freq); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobFreq), "Description: This knob sets the frequency the filter is centered at.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobFreq),"motion-notify-event",G_CALLBACK(on_inv_filter_freq_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobGain), INV_KNOB_SIZE_LARGE); inv_knob_set_curve(INV_KNOB (pluginGui->knobGain), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobGain), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobGain), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobGain), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobGain), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobGain), 12.0); inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobGain), "Description: This knob sets the output gain of the filter.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobGain),"motion-notify-event",G_CALLBACK(on_inv_filter_gain_knob_motion),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, "Off"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, "Active"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), "Description: This switch activates soft-clipping on the output. The soft clipping function outputs a value between -3dB and 0dB for input values between -3dB and +infinity.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleNoClip),"button-release-event",G_CALLBACK(on_inv_filter_noClip_toggle_button_release),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampNoClip),3.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampNoClip), "This glows when soft clipping is occurring."); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIFilterGui(LV2UI_Handle ui) { return; } static void port_eventIFilterGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IFilterGui *pluginGui = (IFilterGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IFILTER_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_display_fg_set_bypass(INV_DISPLAY_FG (pluginGui->display), INV_PLUGIN_ACTIVE); inv_knob_set_bypass(INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_ACTIVE); inv_knob_set_bypass(INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_BYPASS); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_BYPASS); inv_display_fg_set_bypass(INV_DISPLAY_FG (pluginGui->display), INV_PLUGIN_BYPASS); inv_knob_set_bypass(INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_BYPASS); inv_knob_set_bypass(INV_KNOB (pluginGui->knobGain), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IFILTER_FREQ: pluginGui->freq=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFreq), pluginGui->freq); inv_display_fg_set_freq(INV_DISPLAY_FG (pluginGui->display), pluginGui->freq); break; case IFILTER_GAIN: pluginGui->gain=value; inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); inv_display_fg_set_gain(INV_DISPLAY_FG (pluginGui->display), pluginGui->gain); break; case IFILTER_NOCLIP: pluginGui->noClip=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON); } break; case IFILTER_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case IFILTER_METER_INR: if(pluginGui->InChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterIn),value); break; case IFILTER_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case IFILTER_METER_OUTR: if(pluginGui->OutChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; case IFILTER_METER_DRIVE: inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),value); break; } } } static void init() { IFilterGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IFilterGuiDescriptor->URI = IFILTER_GUI_URI; IFilterGuiDescriptor->instantiate = instantiateIFilterGui; IFilterGuiDescriptor->cleanup = cleanupIFilterGui; IFilterGuiDescriptor->port_event = port_eventIFilterGui; IFilterGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IFilterGuiDescriptor) init(); switch (index) { case 0: return IFilterGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_filter_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IFilterGui *pluginGui = (IFilterGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IFILTER_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_filter_freq_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IFilterGui *pluginGui = (IFilterGui *) data; pluginGui->freq=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IFILTER_FREQ, 4, 0, &pluginGui->freq); return; } static void on_inv_filter_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IFilterGui *pluginGui = (IFilterGui *) data; pluginGui->gain=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IFILTER_GAIN, 4, 0, &pluginGui->gain); return; } static void on_inv_filter_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IFilterGui *pluginGui = (IFilterGui *) data; pluginGui->noClip=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IFILTER_NOCLIP, 4, 0, &pluginGui->noClip); return; } static void on_inv_filter_display_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IFilterGui *pluginGui = (IFilterGui *) data; pluginGui->freq=inv_display_fg_get_freq(INV_DISPLAY_FG (widget)); pluginGui->gain=inv_display_fg_get_gain(INV_DISPLAY_FG (widget)); (*pluginGui->write_function)(pluginGui->controller, IFILTER_FREQ, 4, 0, &pluginGui->freq); (*pluginGui->write_function)(pluginGui->controller, IFILTER_GAIN, 4, 0, &pluginGui->gain); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_phaser_gui.c0000664000175000017500000004704011251515772023507 0ustar alessioalessio/* This LV2 extension provides phaser gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_phaser.h" #include "inv_phaser_gui.h" static LV2UI_Descriptor *IPhaserGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *knobCycle; GtkWidget *knobPhase; GtkWidget *lampL; GtkWidget *lampR; GtkWidget *knobWidth; GtkWidget *knobDepth; GtkWidget *toggleNoClip; GtkWidget *lampNoClip; gint InChannels; gint OutChannels; float bypass; float cycle; float phase; float width; float depth; float noclip; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IPhaserGui; static LV2UI_Handle instantiateIPhaserGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IPhaserGui *pluginGui = (IPhaserGui *)malloc(sizeof(IPhaserGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_phaser_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "phaser_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "phaser_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_cycle_knob")); pluginGui->knobCycle = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobCycle); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_phase_knob")); pluginGui->knobPhase = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobPhase); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_l_lamp")); pluginGui->lampL = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampL); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_r_lamp")); pluginGui->lampR = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampR); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_width_knob")); pluginGui->knobWidth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobWidth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_depth_knob")); pluginGui->knobDepth = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDepth); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_toggle")); pluginGui->toggleNoClip = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleNoClip); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_lamp")); pluginGui->lampNoClip = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampNoClip); /* customise for the plugin */ if(!strcmp(plugin_uri,IPHASER_MONO_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Stereo Phaser (mono in)"); pluginGui->InChannels = 1; } if(!strcmp(plugin_uri,IPHASER_STEREO_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Stereo Phaser (stereo in)"); pluginGui->InChannels = 2; } if(!strcmp(plugin_uri,IPHASER_SUM_URI)) { gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Stereo Phaser (sum L+R in)"); pluginGui->InChannels = 1; } pluginGui->OutChannels = 2; pluginGui->bypass = 0.0; pluginGui->cycle = 25.0; pluginGui->phase = 45.0; pluginGui->width = 10.5; pluginGui->depth = 75.0; pluginGui->noclip = 1.0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_phaser_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_knob_set_bypass(INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobCycle), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobCycle), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobCycle), INV_KNOB_MARKINGS_4); inv_knob_set_human(INV_KNOB (pluginGui->knobCycle)); inv_knob_set_units(INV_KNOB (pluginGui->knobCycle), "s"); inv_knob_set_min(INV_KNOB (pluginGui->knobCycle), 0.5); inv_knob_set_max(INV_KNOB (pluginGui->knobCycle), 500.0); inv_knob_set_value(INV_KNOB (pluginGui->knobCycle), pluginGui->cycle); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobCycle), "Description: This knob sets the period of the LFO.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobCycle),"motion-notify-event",G_CALLBACK(on_inv_phaser_cycle_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobPhase), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobPhase), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobPhase), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobPhase), INV_KNOB_MARKINGS_5); inv_knob_set_units(INV_KNOB (pluginGui->knobPhase), ""); inv_knob_set_min(INV_KNOB (pluginGui->knobPhase), -180); inv_knob_set_max(INV_KNOB (pluginGui->knobPhase), 180); inv_knob_set_value(INV_KNOB (pluginGui->knobPhase), pluginGui->phase); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobPhase), "Description: This knob sets the LFO cycle phase difference between the left and right channels.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobPhase),"motion-notify-event",G_CALLBACK(on_inv_phaser_phase_knob_motion),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampL),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampL),1.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampL), "This shows the resultant LFO on the left channel."); inv_lamp_set_value(INV_LAMP (pluginGui->lampR),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampR),1.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampR), "This shows the resultant LFO on the right channel."); inv_knob_set_bypass(INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobWidth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobWidth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobWidth), INV_KNOB_MARKINGS_3); inv_knob_set_units(INV_KNOB (pluginGui->knobWidth), "ms"); inv_knob_set_min(INV_KNOB (pluginGui->knobWidth), 1.0); inv_knob_set_max(INV_KNOB (pluginGui->knobWidth), 15.0); inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobWidth), "Description: This knob sets the maximum delay the LFO will cause (the miniumum delay is fixed to 0.1ms which will cancel a 10kHz signal) Larger maximum delays gives a lower cancellation frequency.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobWidth),"motion-notify-event",G_CALLBACK(on_inv_phaser_width_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDepth), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobDepth), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobDepth), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobDepth), INV_KNOB_MARKINGS_5); inv_knob_set_units(INV_KNOB (pluginGui->knobDepth), "%"); inv_knob_set_min(INV_KNOB (pluginGui->knobDepth), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobDepth), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobDepth), pluginGui->depth); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobDepth), "Description: This knob controls how much of the phased signal is blended back into the original. At 100% they are the same volume.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDepth),"motion-notify-event",G_CALLBACK(on_inv_phaser_depth_knob_motion),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, "Off"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, "Active"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), "Description: This switch activates soft-clipping on the output. The soft clipping function outputs a value between -3dB and 0dB for input values between -3dB and +infinity.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleNoClip),"button-release-event",G_CALLBACK(on_inv_phaser_noclip_toggle_button_release),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampNoClip),3.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampNoClip), "This glows when soft clipping is occurring."); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIPhaserGui(LV2UI_Handle ui) { return; } static void port_eventIPhaserGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IPhaserGui *pluginGui = (IPhaserGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IPHASER_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPhase), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDepth), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobCycle), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobPhase), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobWidth), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobDepth), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IPHASER_CYCLE: pluginGui->cycle=value; inv_knob_set_value(INV_KNOB (pluginGui->knobCycle), pluginGui->cycle); break; case IPHASER_PHASE: pluginGui->phase=value; inv_knob_set_value(INV_KNOB (pluginGui->knobPhase), pluginGui->phase); break; case IPHASER_WIDTH: pluginGui->width=value; inv_knob_set_value(INV_KNOB (pluginGui->knobWidth), pluginGui->width); break; case IPHASER_DEPTH: pluginGui->depth=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDepth), pluginGui->depth); break; case IPHASER_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case IPHASER_METER_INR: if(pluginGui->InChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterIn),value); break; case IPHASER_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case IPHASER_METER_OUTR: inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; case IPHASER_LAMP_L: inv_lamp_set_value(INV_LAMP (pluginGui->lampL),value); break; case IPHASER_LAMP_R: inv_lamp_set_value(INV_LAMP (pluginGui->lampR),value); break; case IPHASER_LAMP_NOCLIP: inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),value); break; } } } static void init() { IPhaserGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IPhaserGuiDescriptor->URI = IPHASER_GUI_URI; IPhaserGuiDescriptor->instantiate = instantiateIPhaserGui; IPhaserGuiDescriptor->cleanup = cleanupIPhaserGui; IPhaserGuiDescriptor->port_event = port_eventIPhaserGui; IPhaserGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IPhaserGuiDescriptor) init(); switch (index) { case 0: return IPhaserGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_phaser_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_phaser_cycle_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->cycle=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_CYCLE, 4, 0, &pluginGui->cycle); return; } static void on_inv_phaser_phase_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->phase=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_PHASE, 4, 0, &pluginGui->phase); return; } static void on_inv_phaser_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->width=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_WIDTH, 4, 0, &pluginGui->width); return; } static void on_inv_phaser_depth_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->depth=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_DEPTH, 4, 0, &pluginGui->depth); return; } static void on_inv_phaser_noclip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IPhaserGui *pluginGui = (IPhaserGui *) data; pluginGui->noclip=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IPHASER_NOCLIP, 4, 0, &pluginGui->noclip); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_phaser_gui.h0000664000175000017500000000247711251515772023521 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_phaser_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_phaser_cycle_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_phaser_phase_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_phaser_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_phaser_depth_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_phaser_noclip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_tube_gui.h0000664000175000017500000000231611251515772023166 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_tube_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tube_drive_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tube_dc_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tube_phase_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tube_blend_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_meter_gui.h0000664000175000017500000000240711251515772023344 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_meter_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_meter_headroom_radio_toggled_3db(GtkWidget *widget, gpointer data); static void on_inv_meter_headroom_radio_toggled_6db(GtkWidget *widget, gpointer data); static void on_inv_meter_headroom_radio_toggled_9db(GtkWidget *widget, gpointer data); static void on_inv_meter_headroom_radio_toggled_12db(GtkWidget *widget, gpointer data); static void on_inv_meter_headroom_radio_toggled_15db(GtkWidget *widget, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_testtone_gui.h0000664000175000017500000001012711251515772024073 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* enum for test tones tree */ enum { TV1_COLUMN_SCALE = 0, TV1_COLUMN_A, //20 TV1_COLUMN_B, //25 TV1_COLUMN_C, //31.5 TV1_COLUMN_D, //40 TV1_COLUMN_E, //50 TV1_COLUMN_F, //63 TV1_COLUMN_G, //80 TV1_COLUMN_H, //100 TV1_COLUMN_I, //125 TV1_COLUMN_J, //160 TV1_COLUMN_TOOLTIP, TV1_NUM_COLS }; /* enum for musical tones tree */ enum { TV2_COLUMN_OCTAVE = 0, TV2_COLUMN_A, //C TV2_COLUMN_B, //C# TV2_COLUMN_C, //D TV2_COLUMN_D, //D# TV2_COLUMN_E, //E TV2_COLUMN_F, //F TV2_COLUMN_G, //F# TV2_COLUMN_H, //G TV2_COLUMN_I, //G# TV2_COLUMN_J, //A TV2_COLUMN_K, //A# TV2_COLUMN_L, //B TV2_COLUMN_TOOLTIP, TV2_NUM_COLS }; /*helper functions */ static gint inv_tone_get_col_number_from_tree_view_column (GtkTreeViewColumn *col); static void inv_tone_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gint pos); static void inv_tone_cola_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colb_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colc_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_cold_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_cole_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colf_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colg_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colh_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_coli_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colj_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_colk_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_coll_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_tone_create_testtone(GtkWidget *tree); static void inv_tone_create_musictone(GtkWidget *tree); /*callbacks*/ static void on_inv_tone_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tone_freq_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tone_trim_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tone_test_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_tone_music_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_delay_gui.h0000664000175000017500000000767111251515772023336 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* enum for delay calc tree */ enum { COLUMN_NOTE = 0, COLUMN_LENGTH, COLUMN_DOTTED, COLUMN_TUPLET32, COLUMN_TUPLET54, COLUMN_TUPLET74, COLUMN_TUPLET94, COLUMN_TUPLET114, COLUMN_TOOLTIP, NUM_COLS }; /* helper functions */ static gint inv_delay_get_col_number_from_tree_view_column (GtkTreeViewColumn *col); static void inv_delay_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gint pos); static void inv_delay_length_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_dotted_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_tuplet32_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_tuplet54_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_tuplet74_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_tuplet94_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_tuplet114_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data); static void inv_delay_init_delaycalc(GtkWidget *tree); static void inv_delay_update_delaycalc(GtkWidget *tree, float tempo); /* call backs */ static void on_inv_delay_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_mode_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_mungemode_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_munge_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_cycle_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_width_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_delay1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_fb1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_pan1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_vol1_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_delay2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_fb2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_pan2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_vol2_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_delay_tempo_value_changed(GtkWidget *widget, gpointer data); static void on_inv_delay_calc_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/inv_testtone_gui.c0000664000175000017500000010163011251515772024066 0ustar alessioalessio/* This LV2 extension provides input module gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/meter-phase.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_testtone.h" #include "inv_testtone_gui.h" static LV2UI_Descriptor *IToneGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterOut; GtkWidget *knobFreq; GtkWidget *knobTrim; GtkWidget *treeTest; GtkWidget *treeMusic; gint OutChannels; float bypass; float freq; float trim; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IToneGui; static LV2UI_Handle instantiateIToneGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IToneGui *pluginGui = (IToneGui *)malloc(sizeof(IToneGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_testtone_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "testtone_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "testtone_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); pluginGui->treeTest = GTK_WIDGET (gtk_builder_get_object (builder, "treeview_testtones")); pluginGui->treeMusic = GTK_WIDGET (gtk_builder_get_object (builder, "treeview_musictones")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_frequency_knob")); pluginGui->knobFreq = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobFreq); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_trim_knob")); pluginGui->knobTrim = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobTrim); pluginGui->OutChannels = 1; pluginGui->bypass = 0.0; pluginGui->freq = 1000.0; pluginGui->trim = 0.0; inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_BIGTOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "On"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Off"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch activates the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_tone_bypass_toggle_button_release),pluginGui); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_ACTIVE); inv_knob_set_size( INV_KNOB (pluginGui->knobFreq), INV_KNOB_SIZE_LARGE); inv_knob_set_curve( INV_KNOB (pluginGui->knobFreq), INV_KNOB_CURVE_LOG); inv_knob_set_markings( INV_KNOB (pluginGui->knobFreq), INV_KNOB_MARKINGS_4); inv_knob_set_highlight(INV_KNOB (pluginGui->knobFreq), INV_KNOB_HIGHLIGHT_C); inv_knob_set_human( INV_KNOB (pluginGui->knobFreq)); inv_knob_set_units( INV_KNOB (pluginGui->knobFreq), "Hz"); inv_knob_set_min( INV_KNOB (pluginGui->knobFreq), 20.0); inv_knob_set_max( INV_KNOB (pluginGui->knobFreq), 20000.0); inv_knob_set_value( INV_KNOB (pluginGui->knobFreq), pluginGui->freq); inv_knob_set_tooltip( INV_KNOB (pluginGui->knobFreq), "Description: This knob sets the oscillator frequency.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobFreq),"motion-notify-event",G_CALLBACK(on_inv_tone_freq_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobTrim), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobTrim), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobTrim), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobTrim), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobTrim), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobTrim), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobTrim), -24.0); inv_knob_set_max(INV_KNOB (pluginGui->knobTrim), 0.0); inv_knob_set_value(INV_KNOB (pluginGui->knobTrim), pluginGui->trim); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobTrim), "Description: This knob sets the output trim.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobTrim),"motion-notify-event",G_CALLBACK(on_inv_tone_trim_knob_motion),pluginGui); inv_tone_create_testtone(pluginGui->treeTest); g_signal_connect_after(G_OBJECT(pluginGui->treeTest),"button-release-event",G_CALLBACK(on_inv_tone_test_button_release),pluginGui); inv_tone_create_musictone(pluginGui->treeMusic); g_signal_connect_after(G_OBJECT(pluginGui->treeMusic),"button-release-event",G_CALLBACK(on_inv_tone_music_button_release),pluginGui); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIToneGui(LV2UI_Handle ui) { return; } static void port_eventIToneGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IToneGui *pluginGui = (IToneGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case ITONE_ACTIVE: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobTrim), INV_PLUGIN_ACTIVE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeTest), TRUE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeMusic), TRUE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobFreq), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobTrim), INV_PLUGIN_BYPASS); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeTest), FALSE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->treeMusic), FALSE); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case ITONE_FREQ: pluginGui->freq=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFreq), pluginGui->freq); break; case ITONE_TRIM: pluginGui->trim=value; inv_knob_set_value(INV_KNOB (pluginGui->knobTrim), pluginGui->trim); break; case ITONE_METER_OUT: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; } } } static void init() { IToneGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IToneGuiDescriptor->URI = ITONE_GUI_URI; IToneGuiDescriptor->instantiate = instantiateIToneGui; IToneGuiDescriptor->cleanup = cleanupIToneGui; IToneGuiDescriptor->port_event = port_eventIToneGui; IToneGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IToneGuiDescriptor) init(); switch (index) { case 0: return IToneGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static gint inv_tone_get_col_number_from_tree_view_column (GtkTreeViewColumn *col) { GList *cols; gint num; g_return_val_if_fail ( col != NULL, -1 ); g_return_val_if_fail ( col->tree_view != NULL, -1 ); cols = gtk_tree_view_get_columns(GTK_TREE_VIEW(col->tree_view)); num = g_list_index(cols, (gpointer) col); g_list_free(cols); return num; } static void inv_tone_cell_data_function ( GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gint pos) { gfloat value; gchar buf[20]; gtk_tree_model_get(model, iter, pos, &value, -1); if(value < 20) { g_snprintf(buf, sizeof(buf), " "); } else if(value < 100) { g_snprintf(buf, sizeof(buf), "%.1fHz ", floor(value*10)/10); } else if(value < 1000) { g_snprintf(buf, sizeof(buf), "%.0fHz", floor(value)); } else if(value < 10000) { g_snprintf(buf, sizeof(buf), "%.2fkHz", floor(value/10)/100); } else if(value <= 20000) { g_snprintf(buf, sizeof(buf), "%.1fkHz", floor(value/100)/10); } else { g_snprintf(buf, sizeof(buf), " "); } g_object_set(renderer, "text", buf, NULL); } static void inv_tone_cola_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,1); } static void inv_tone_colb_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,2); } static void inv_tone_colc_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,3); } static void inv_tone_cold_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,4); } static void inv_tone_cole_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,5); } static void inv_tone_colf_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,6); } static void inv_tone_colg_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,7); } static void inv_tone_colh_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,8); } static void inv_tone_coli_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,9); } static void inv_tone_colj_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,10); } static void inv_tone_colk_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,11); } static void inv_tone_coll_cell_data_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { inv_tone_cell_data_function (col,renderer,model,iter,12); } static void inv_tone_create_testtone(GtkWidget *tree) { GtkTreeViewColumn *col; GtkCellRenderer *renderer; // define columns /* mult */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Multiplier"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",0.5,NULL); g_object_set (renderer,"weight",800,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_add_attribute(col, renderer, "text", TV1_COLUMN_SCALE); /* 20 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "20"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cola_cell_data_function, NULL, NULL); /* 25 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "25"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colb_cell_data_function, NULL, NULL); /* 31.5 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "31.5"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colc_cell_data_function, NULL, NULL); /* 40 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "40"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cold_cell_data_function, NULL, NULL); /* 50 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "50"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cole_cell_data_function, NULL, NULL); /* 63 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "63"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colf_cell_data_function, NULL, NULL); /* 80 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "80"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colg_cell_data_function, NULL, NULL); /* 100 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "100"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colh_cell_data_function, NULL, NULL); /* 125 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "125"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_coli_cell_data_function, NULL, NULL); /* 160 */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "160"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colj_cell_data_function, NULL, NULL); /* tooltips */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "tooltips"); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); gtk_tree_view_column_set_visible (col,FALSE); gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(tree),TV1_COLUMN_TOOLTIP); GtkListStore *liststore; GtkTreeIter iter; gint i,mul; char notelabel[8]; // create empty store liststore = gtk_list_store_new( TV1_NUM_COLS, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_STRING); for(i=0;i<4;i++) { gtk_list_store_append(liststore, &iter); mul=(int)pow(10,i); sprintf(notelabel,"%ix ",mul); gtk_list_store_set (liststore, &iter, TV1_COLUMN_SCALE, notelabel, TV1_COLUMN_A, (float)mul*20.0, TV1_COLUMN_B, (float)mul*25, TV1_COLUMN_C, (float)mul*31.5, TV1_COLUMN_D, (float)mul*40, TV1_COLUMN_E, (float)mul*50, TV1_COLUMN_F, (float)mul*63, TV1_COLUMN_G, (float)mul*80, TV1_COLUMN_H, (float)mul*100, TV1_COLUMN_I, (float)mul*125, TV1_COLUMN_J, (float)mul*160, TV1_COLUMN_TOOLTIP, "Description: Test tones at standard 1/3 octave frequencies.\nUsage: Left-Click on a cell to assign the value to the oscillator.", -1); } // add the model to the treeview gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(liststore)); return; } static void inv_tone_create_musictone(GtkWidget *tree) { GtkTreeViewColumn *col; GtkCellRenderer *renderer; // define columns /* octave */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Ocatve"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",0.5,NULL); g_object_set (renderer,"weight",800,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_add_attribute(col, renderer, "text", TV2_COLUMN_OCTAVE); /* C */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "C"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cola_cell_data_function, NULL, NULL); /* C# */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "C#"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colb_cell_data_function, NULL, NULL); /* D */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "D"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colc_cell_data_function, NULL, NULL); /* D# */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "D#"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cold_cell_data_function, NULL, NULL); /* E */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "E"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_cole_cell_data_function, NULL, NULL); /* F */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "F"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colf_cell_data_function, NULL, NULL); /* F# */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "F#"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colg_cell_data_function, NULL, NULL); /* G */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "G"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colh_cell_data_function, NULL, NULL); /* G# */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "G#"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_coli_cell_data_function, NULL, NULL); /* A */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "A"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colj_cell_data_function, NULL, NULL); /* A# */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "A#"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_colk_cell_data_function, NULL, NULL); /* B */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "B"); gtk_tree_view_column_set_spacing(col,2); gtk_tree_view_column_set_alignment(col,0.5); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); renderer = gtk_cell_renderer_text_new(); g_object_set (renderer,"xalign",1.0,NULL); g_object_set (renderer,"size",8000,NULL); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(col, renderer, inv_tone_coll_cell_data_function, NULL, NULL); /* tooltips */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "tooltips"); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col); gtk_tree_view_column_set_visible (col,FALSE); gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(tree),TV2_COLUMN_TOOLTIP); GtkListStore *liststore; GtkTreeIter iter; gint i; float scale; char notelabel[8]; // create empty store liststore = gtk_list_store_new( TV2_NUM_COLS, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_STRING); for(i=0;i<11;i++) { gtk_list_store_append(liststore, &iter); scale=pow(2,i-5); sprintf(notelabel,"%i",i); gtk_list_store_set (liststore, &iter, TV2_COLUMN_OCTAVE, notelabel, TV2_COLUMN_A, scale*440.0*pow(2,3.0/12.0), TV2_COLUMN_B, scale*440.0*pow(2,4.0/12.0), TV2_COLUMN_C, scale*440.0*pow(2,5.0/12.0), TV2_COLUMN_D, scale*440.0*pow(2,6.0/12.0), TV2_COLUMN_E, scale*440.0*pow(2,7.0/12.0), TV2_COLUMN_F, scale*440.0*pow(2,8.0/12.0), TV2_COLUMN_G, scale*440.0*pow(2,9.0/12.0), TV2_COLUMN_H, scale*440.0*pow(2,10.0/12.0), TV2_COLUMN_I, scale*440.0*pow(2,11.0/12.0), TV2_COLUMN_J, 2*scale*440.0, TV2_COLUMN_K, 2*scale*440.0*pow(2,1.0/12.0), TV2_COLUMN_L, 2*scale*440.0*pow(2,2.0/12.0), TV2_COLUMN_TOOLTIP, "Description: Test tones at musical frequencies.\nUsage: Left-Click on a cell to assign the value to the oscillator.", -1); } // add the model to the treeview gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(liststore)); return; } /*****************************************************************************/ static void on_inv_tone_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IToneGui *pluginGui = (IToneGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, ITONE_ACTIVE, 4, 0, &pluginGui->bypass); return; } static void on_inv_tone_freq_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IToneGui *pluginGui = (IToneGui *) data; pluginGui->freq=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ITONE_FREQ, 4, 0, &pluginGui->freq); return; } static void on_inv_tone_trim_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { IToneGui *pluginGui = (IToneGui *) data; pluginGui->trim=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ITONE_TRIM, 4, 0, &pluginGui->trim); return; } static void on_inv_tone_test_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { GtkTreePath *path; GtkTreeViewColumn *column; GtkTreeModel *model; GtkTreeIter iter; gfloat value; gint col; IToneGui *pluginGui = (IToneGui *) data; model = gtk_tree_view_get_model(GTK_TREE_VIEW (pluginGui->treeTest)); gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW (pluginGui->treeTest), (gint) ((GdkEventButton*)event)->x, (gint) ((GdkEventButton*)event)->y, &path, &column, NULL, NULL); col=inv_tone_get_col_number_from_tree_view_column(column); if (col > 0 && gtk_tree_model_get_iter(model, &iter, path)) { gtk_tree_model_get(model, &iter, col, &value, -1); if(value >= 20.0 && value <= 20000.0) { pluginGui->freq=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFreq), pluginGui->freq); (*pluginGui->write_function)(pluginGui->controller, ITONE_FREQ, 4, 0, &pluginGui->freq); } } gtk_tree_path_free(path); return; } static void on_inv_tone_music_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { GtkTreePath *path; GtkTreeViewColumn *column; GtkTreeModel *model; GtkTreeIter iter; gfloat value; gint col; IToneGui *pluginGui = (IToneGui *) data; model = gtk_tree_view_get_model(GTK_TREE_VIEW (pluginGui->treeMusic)); gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW (pluginGui->treeMusic), (gint) ((GdkEventButton*)event)->x, (gint) ((GdkEventButton*)event)->y, &path, &column, NULL, NULL); col=inv_tone_get_col_number_from_tree_view_column(column); if (col > 0 && gtk_tree_model_get_iter(model, &iter, path)) { gtk_tree_model_get(model, &iter, col, &value, -1); if(value >= 20.0 && value <= 20000.0) { pluginGui->freq=value; inv_knob_set_value(INV_KNOB (pluginGui->knobFreq), pluginGui->freq); (*pluginGui->write_function)(pluginGui->controller, ITONE_FREQ, 4, 0, &pluginGui->freq); } } gtk_tree_path_free(path); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_tube_gui.c0000664000175000017500000004051111251515772023160 0ustar alessioalessio/* This LV2 extension provides tube gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_tube.h" #include "inv_tube_gui.h" static LV2UI_Descriptor *ITubeGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterOut; GtkWidget *knobDrive; GtkWidget *lampDrive; GtkWidget *knobDC; GtkWidget *togglePhase; GtkWidget *knobBlend; gint InChannels; gint OutChannels; float bypass; float drive; float dc; float phase; float blend; LV2UI_Write_Function write_function; LV2UI_Controller controller; } ITubeGui; static LV2UI_Handle instantiateITubeGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { ITubeGui *pluginGui = (ITubeGui *)malloc(sizeof(ITubeGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_tube_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "tube_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "tube_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_drive_knob")); pluginGui->knobDrive = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDrive); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_drive_lamp")); pluginGui->lampDrive = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampDrive); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_dc_knob")); pluginGui->knobDC = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobDC); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_phase_toggle")); pluginGui->togglePhase = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->togglePhase); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_blend_knob")); pluginGui->knobBlend = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobBlend); /* customise for the plugin */ if(!strcmp(plugin_uri,ITUBE_MONO_URI)) { pluginGui->InChannels=1; pluginGui->OutChannels=1; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Tube Distortion (mono)"); } if(!strcmp(plugin_uri,ITUBE_STEREO_URI)) { pluginGui->InChannels=2; pluginGui->OutChannels=2; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Tube Distortion (stereo)"); } pluginGui->bypass=0.0; pluginGui->drive=0.0; pluginGui->dc=0.0; pluginGui->phase=0; pluginGui->blend=75; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_tube_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDrive), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobDrive), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobDrive), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobDrive), INV_KNOB_MARKINGS_4); inv_knob_set_highlight(INV_KNOB (pluginGui->knobDrive), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobDrive), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobDrive), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobDrive), 18.0); inv_knob_set_value(INV_KNOB (pluginGui->knobDrive), pluginGui->drive); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobDrive), "Description: This knob sets the drive or input gain of the tube.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDrive),"motion-notify-event",G_CALLBACK(on_inv_tube_drive_knob_motion),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampDrive),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampDrive),1.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampDrive), "This glows when distortion is occurring."); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDC), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobDC), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobDC), INV_KNOB_CURVE_QUAD); inv_knob_set_markings(INV_KNOB (pluginGui->knobDC), INV_KNOB_MARKINGS_3); inv_knob_set_highlight(INV_KNOB (pluginGui->knobDC), INV_KNOB_HIGHLIGHT_C); inv_knob_set_units(INV_KNOB (pluginGui->knobDC), ""); inv_knob_set_min(INV_KNOB (pluginGui->knobDC), -1.0); inv_knob_set_max(INV_KNOB (pluginGui->knobDC), 1.0); inv_knob_set_value(INV_KNOB (pluginGui->knobDC), pluginGui->dc); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobDC), "Description: This knob sends the signal into the tube with a DC offset. This causes asymmetrical distortion.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobDC),"motion-notify-event",G_CALLBACK(on_inv_tube_dc_knob_motion),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_OFF, "Normal"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_ON, "Reversed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->togglePhase), "Description: This switch sets the phase of the tube. Reversed phase tube sounds best with 30%-40% blend.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->togglePhase),"button-release-event",G_CALLBACK(on_inv_tube_phase_toggle_button_release),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobBlend), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobBlend), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobBlend), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobBlend), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobBlend), INV_KNOB_HIGHLIGHT_C); inv_knob_set_units(INV_KNOB (pluginGui->knobBlend), "%"); inv_knob_set_min(INV_KNOB (pluginGui->knobBlend), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobBlend), 100.0); inv_knob_set_value(INV_KNOB (pluginGui->knobBlend), pluginGui->blend); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobBlend), "Description: This knob sends the blend of the tube with the original signal.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobBlend),"motion-notify-event",G_CALLBACK(on_inv_tube_blend_knob_motion),pluginGui); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupITubeGui(LV2UI_Handle ui) { return; } static void port_eventITubeGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { ITubeGui *pluginGui = (ITubeGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case ITUBE_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDrive), INV_PLUGIN_ACTIVE); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDC), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_PLUGIN_ACTIVE); inv_knob_set_bypass(INV_KNOB (pluginGui->knobBlend), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_BYPASS); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_BYPASS); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDrive), INV_PLUGIN_BYPASS); inv_knob_set_bypass(INV_KNOB (pluginGui->knobDC), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_PLUGIN_BYPASS); inv_knob_set_bypass(INV_KNOB (pluginGui->knobBlend), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case ITUBE_DRIVE: pluginGui->drive=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDrive), pluginGui->drive); break; case ITUBE_DCOFFSET: pluginGui->dc=value; inv_knob_set_value(INV_KNOB (pluginGui->knobDC), pluginGui->dc); break; case ITUBE_PHASE: pluginGui->phase=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->togglePhase), INV_SWITCH_TOGGLE_ON); } break; case ITUBE_MIX: pluginGui->blend=value; inv_knob_set_value(INV_KNOB (pluginGui->knobBlend), pluginGui->blend); break; case ITUBE_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case ITUBE_METER_INR: if(pluginGui->InChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterIn),value); break; case ITUBE_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case ITUBE_METER_OUTR: if(pluginGui->OutChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; case ITUBE_METER_DRIVE: inv_lamp_set_value(INV_LAMP (pluginGui->lampDrive),value); break; } } } static void init() { ITubeGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); ITubeGuiDescriptor->URI = ITUBE_GUI_URI; ITubeGuiDescriptor->instantiate = instantiateITubeGui; ITubeGuiDescriptor->cleanup = cleanupITubeGui; ITubeGuiDescriptor->port_event = port_eventITubeGui; ITubeGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!ITubeGuiDescriptor) init(); switch (index) { case 0: return ITubeGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_tube_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { ITubeGui *pluginGui = (ITubeGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, ITUBE_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_tube_drive_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ITubeGui *pluginGui = (ITubeGui *) data; pluginGui->drive=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ITUBE_DRIVE, 4, 0, &pluginGui->drive); return; } static void on_inv_tube_dc_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ITubeGui *pluginGui = (ITubeGui *) data; pluginGui->dc=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ITUBE_DCOFFSET, 4, 0, &pluginGui->dc); return; } static void on_inv_tube_phase_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { ITubeGui *pluginGui = (ITubeGui *) data; pluginGui->phase=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, ITUBE_PHASE, 4, 0, &pluginGui->phase); return; } static void on_inv_tube_blend_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ITubeGui *pluginGui = (ITubeGui *) data; pluginGui->blend=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ITUBE_MIX, 4, 0, &pluginGui->blend); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_meter_gui.c0000664000175000017500000003373111251515772023343 0ustar alessioalessio/* This LV2 extension provides input module gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/meter-peak.h" #include "widgets/meter-phase.h" #include "widgets/meter-vu.h" #include "widgets/switch-toggle.h" #include "widgets/display-Spectrograph.h" #include "../plugin/inv_meter.h" #include "inv_meter_gui.h" static LV2UI_Descriptor *IMeterGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterPeak; GtkWidget *meterVUL; GtkWidget *meterVUR; GtkWidget *radio3db; GtkWidget *radio6db; GtkWidget *radio9db; GtkWidget *radio12db; GtkWidget *radio15db; GtkWidget *meterPhase; GtkWidget *specDisplay; gint InChannels; gint OutChannels; float bypass; gint specLast; gint specCount; LV2UI_Write_Function write_function; LV2UI_Controller controller; } IMeterGui; static LV2UI_Handle instantiateIMeterGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { IMeterGui *pluginGui = (IMeterGui *)malloc(sizeof(IMeterGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_meter_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "meter_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "meter_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_peak")); pluginGui->meterPeak = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterPeak); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_vu_l")); pluginGui->meterVUL = inv_vu_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterVUL); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_vu_r")); pluginGui->meterVUR = inv_vu_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterVUR); pluginGui->radio3db = GTK_WIDGET (gtk_builder_get_object (builder, "radio3db")); pluginGui->radio6db = GTK_WIDGET (gtk_builder_get_object (builder, "radio6db")); pluginGui->radio9db = GTK_WIDGET (gtk_builder_get_object (builder, "radio9db")); pluginGui->radio12db = GTK_WIDGET (gtk_builder_get_object (builder, "radio12db")); pluginGui->radio15db = GTK_WIDGET (gtk_builder_get_object (builder, "radio15db")); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_phase")); pluginGui->meterPhase = inv_phase_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterPhase); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_spec_display")); pluginGui->specDisplay = inv_display_spec_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->specDisplay); pluginGui->InChannels = 2; pluginGui->OutChannels = 2; pluginGui->bypass = 0.0; pluginGui->specLast = 0; pluginGui->specCount = 0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_meter_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterPeak),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterPeak), INV_METER_DRAW_MODE_BIGTOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterPeak), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterPeak),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterPeak),-90); inv_vu_meter_set_bypass(INV_VU_METER (pluginGui->meterVUL),INV_PLUGIN_ACTIVE); inv_vu_meter_set_bypass(INV_VU_METER (pluginGui->meterVUR),INV_PLUGIN_ACTIVE); g_signal_connect_after(G_OBJECT(pluginGui->radio3db),"toggled",G_CALLBACK(on_inv_meter_headroom_radio_toggled_3db),pluginGui); g_signal_connect_after(G_OBJECT(pluginGui->radio6db),"toggled",G_CALLBACK(on_inv_meter_headroom_radio_toggled_6db),pluginGui); g_signal_connect_after(G_OBJECT(pluginGui->radio9db),"toggled",G_CALLBACK(on_inv_meter_headroom_radio_toggled_9db),pluginGui); g_signal_connect_after(G_OBJECT(pluginGui->radio12db),"toggled",G_CALLBACK(on_inv_meter_headroom_radio_toggled_12db),pluginGui); g_signal_connect_after(G_OBJECT(pluginGui->radio15db),"toggled",G_CALLBACK(on_inv_meter_headroom_radio_toggled_15db),pluginGui); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pluginGui->radio9db),TRUE); inv_phase_meter_set_bypass(INV_PHASE_METER (pluginGui->meterPhase),INV_PLUGIN_ACTIVE); inv_phase_meter_set_phase(INV_PHASE_METER (pluginGui->meterPhase),0); inv_display_spec_set_bypass(INV_DISPLAY_SPEC (pluginGui->specDisplay),INV_PLUGIN_ACTIVE); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupIMeterGui(LV2UI_Handle ui) { return; } static void port_eventIMeterGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { IMeterGui *pluginGui = (IMeterGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case IMETER_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterPeak), INV_PLUGIN_ACTIVE); inv_vu_meter_set_bypass( INV_VU_METER (pluginGui->meterVUL), INV_PLUGIN_ACTIVE); inv_vu_meter_set_bypass( INV_VU_METER (pluginGui->meterVUR), INV_PLUGIN_ACTIVE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio3db), TRUE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio6db), TRUE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio9db), TRUE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio12db), TRUE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio15db), TRUE); inv_phase_meter_set_bypass( INV_PHASE_METER (pluginGui->meterPhase), INV_PLUGIN_ACTIVE); inv_display_spec_set_bypass( INV_DISPLAY_SPEC (pluginGui->specDisplay), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterPeak), INV_PLUGIN_BYPASS); inv_vu_meter_set_bypass( INV_VU_METER (pluginGui->meterVUL), INV_PLUGIN_BYPASS); inv_vu_meter_set_bypass( INV_VU_METER (pluginGui->meterVUR), INV_PLUGIN_BYPASS); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio3db), FALSE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio6db), FALSE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio9db), FALSE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio12db), FALSE); gtk_widget_set_sensitive( GTK_WIDGET (pluginGui->radio15db), FALSE); inv_phase_meter_set_bypass( INV_PHASE_METER (pluginGui->meterPhase), INV_PLUGIN_BYPASS); inv_display_spec_set_bypass( INV_DISPLAY_SPEC (pluginGui->specDisplay), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case IMETER_METER_L: inv_meter_set_LdB(INV_METER (pluginGui->meterPeak),value); break; case IMETER_METER_R: inv_meter_set_RdB(INV_METER (pluginGui->meterPeak),value); break; case IMETER_VU_L: inv_vu_meter_set_value(INV_VU_METER (pluginGui->meterVUL),value); break; case IMETER_VU_R: inv_vu_meter_set_value(INV_VU_METER (pluginGui->meterVUR),value); break; case IMETER_METER_PHASE: inv_phase_meter_set_phase(INV_PHASE_METER (pluginGui->meterPhase),value); break; case IMETER_SPEC_20: case IMETER_SPEC_25: case IMETER_SPEC_31: case IMETER_SPEC_40: case IMETER_SPEC_50: case IMETER_SPEC_63: case IMETER_SPEC_80: case IMETER_SPEC_100: case IMETER_SPEC_125: case IMETER_SPEC_160: case IMETER_SPEC_200: case IMETER_SPEC_250: case IMETER_SPEC_315: case IMETER_SPEC_400: case IMETER_SPEC_500: case IMETER_SPEC_630: case IMETER_SPEC_800: case IMETER_SPEC_1000: case IMETER_SPEC_1250: case IMETER_SPEC_1600: case IMETER_SPEC_2000: case IMETER_SPEC_2500: case IMETER_SPEC_3150: case IMETER_SPEC_4000: case IMETER_SPEC_5000: case IMETER_SPEC_6300: case IMETER_SPEC_8000: case IMETER_SPEC_10000: case IMETER_SPEC_12500: case IMETER_SPEC_16000: case IMETER_SPEC_20000: inv_display_spec_set_value(INV_DISPLAY_SPEC (pluginGui->specDisplay),port-10,value); if(port < pluginGui->specLast) { pluginGui->specCount++; if(pluginGui->specCount > 10) { pluginGui->specCount=0; gtk_widget_queue_draw (pluginGui->specDisplay); } } pluginGui->specLast=port; break; } } } static void init() { IMeterGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); IMeterGuiDescriptor->URI = IMETER_GUI_URI; IMeterGuiDescriptor->instantiate = instantiateIMeterGui; IMeterGuiDescriptor->cleanup = cleanupIMeterGui; IMeterGuiDescriptor->port_event = port_eventIMeterGui; IMeterGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!IMeterGuiDescriptor) init(); switch (index) { case 0: return IMeterGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_meter_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, IMETER_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_meter_headroom_radio_toggled_3db(GtkWidget *widget, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; if(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) { inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUL),3); inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUR),3); } } static void on_inv_meter_headroom_radio_toggled_6db(GtkWidget *widget, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; if(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) { inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUL),6); inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUR),6); } } static void on_inv_meter_headroom_radio_toggled_9db(GtkWidget *widget, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; if(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) { inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUL),9); inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUR),9); } } static void on_inv_meter_headroom_radio_toggled_12db(GtkWidget *widget, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; if(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) { inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUL),12); inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUR),12); } } static void on_inv_meter_headroom_radio_toggled_15db(GtkWidget *widget, gpointer data) { IMeterGui *pluginGui = (IMeterGui *) data; if(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) { inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUL),15); inv_vu_meter_set_headroom(INV_VU_METER (pluginGui->meterVUR),15); } } invada-studio-plugins-lv2-1.2.0/plugingui/inv_compressor_gui.c0000664000175000017500000006214511251515772024424 0ustar alessioalessio/* This LV2 extension provides compressor gui's (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "lv2_ui.h" #include "widgets/widgets.h" #include "widgets/display-Compressor.h" #include "widgets/knob.h" #include "widgets/lamp.h" #include "widgets/meter-peak.h" #include "widgets/switch-toggle.h" #include "../plugin/inv_compressor.h" #include "inv_compressor_gui.h" static LV2UI_Descriptor *ICompGuiDescriptor = NULL; typedef struct { GtkWidget *windowContainer; GtkWidget *heading; GtkWidget *toggleBypass; GtkWidget *meterIn; GtkWidget *meterGR; GtkWidget *meterOut; GtkWidget *display; GtkWidget *knobRms; GtkWidget *knobAttack; GtkWidget *knobRelease; GtkWidget *knobThreshold; GtkWidget *knobRatio; GtkWidget *knobGain; GtkWidget *toggleNoClip; GtkWidget *lampNoClip; gint InChannels; gint GRChannels; gint OutChannels; float bypass; float rms; float attack; float release; float threshold; float ratio; float gain; float noClip; LV2UI_Write_Function write_function; LV2UI_Controller controller; } ICompGui; static LV2UI_Handle instantiateICompGui(const struct _LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { ICompGui *pluginGui = (ICompGui *)malloc(sizeof(ICompGui)); if(pluginGui==NULL) return NULL; pluginGui->write_function = write_function; pluginGui->controller = controller; GtkBuilder *builder; GtkWidget *window; GtkWidget *tempObject; char *file; GError *err = NULL; gtk_init (NULL,NULL); builder = gtk_builder_new (); file = g_strdup_printf("%s/gtk/inv_compressor_gui.xml",bundle_path); gtk_builder_add_from_file (builder, file, &err); free(file); window = GTK_WIDGET (gtk_builder_get_object (builder, "comp_window")); /* get pointers to some useful widgets from the design */ pluginGui->windowContainer = GTK_WIDGET (gtk_builder_get_object (builder, "comp_container")); pluginGui->heading = GTK_WIDGET (gtk_builder_get_object (builder, "label_heading")); /* add custom widgets */ tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_bypass_toggle")); pluginGui->toggleBypass = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleBypass); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_in")); pluginGui->meterIn = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterIn); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_gr")); pluginGui->meterGR = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterGR); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_meter_out")); pluginGui->meterOut = inv_meter_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->meterOut); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_comp_display")); pluginGui->display = inv_display_comp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->display); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_rms_knob")); pluginGui->knobRms = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobRms); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_attack_knob")); pluginGui->knobAttack = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobAttack); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_release_knob")); pluginGui->knobRelease = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobRelease); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_threshold_knob")); pluginGui->knobThreshold = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobThreshold); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_ratio_knob")); pluginGui->knobRatio = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobRatio); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_makeupgain_knob")); pluginGui->knobGain = inv_knob_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->knobGain); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_toggle")); pluginGui->toggleNoClip = inv_switch_toggle_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->toggleNoClip); tempObject=GTK_WIDGET (gtk_builder_get_object (builder, "alignment_noclip_lamp")); pluginGui->lampNoClip = inv_lamp_new (); gtk_container_add (GTK_CONTAINER (tempObject), pluginGui->lampNoClip); /* customise for the plugin */ if(!strcmp(plugin_uri,ICOMP_MONO_URI)) { pluginGui->InChannels=1; pluginGui->OutChannels=1; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Invada Compressor (mono)"); } if(!strcmp(plugin_uri,ICOMP_STEREO_URI)) { pluginGui->InChannels=2; pluginGui->OutChannels=2; gtk_label_set_markup (GTK_LABEL (pluginGui->heading), "Invada Compressor (stereo)"); } pluginGui->GRChannels = 1; pluginGui->bypass = 0.0; pluginGui->rms = 0.5; pluginGui->attack = 0.015; pluginGui->release = 0.050; pluginGui->threshold = 0.0; pluginGui->ratio = 1.0; pluginGui->gain = 0.0; pluginGui->noClip = 0.0; inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF, "Active"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, 1.0, 0.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON, "Bypassed"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), "Description: This switch bypasses the plugin.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleBypass),"button-release-event",G_CALLBACK(on_inv_comp_bypass_toggle_button_release),pluginGui); inv_meter_set_bypass(INV_METER (pluginGui->meterIn),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterIn), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterIn), pluginGui->InChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterIn),-90); inv_meter_set_bypass(INV_METER (pluginGui->meterGR),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterGR), INV_METER_DRAW_MODE_FROMZERO); inv_meter_set_channels(INV_METER (pluginGui->meterGR), pluginGui->GRChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterGR),0); inv_meter_set_bypass(INV_METER (pluginGui->meterOut),INV_PLUGIN_ACTIVE); inv_meter_set_mode(INV_METER (pluginGui->meterOut), INV_METER_DRAW_MODE_TOZERO); inv_meter_set_channels(INV_METER (pluginGui->meterOut), pluginGui->OutChannels); inv_meter_set_LdB(INV_METER (pluginGui->meterOut),-90); inv_meter_set_RdB(INV_METER (pluginGui->meterOut),-90); inv_display_comp_set_bypass(INV_DISPLAY_COMP (pluginGui->display), INV_PLUGIN_ACTIVE); inv_display_comp_set_rms(INV_DISPLAY_COMP (pluginGui->display), pluginGui->rms); inv_display_comp_set_attack(INV_DISPLAY_COMP (pluginGui->display), pluginGui->attack); inv_display_comp_set_release(INV_DISPLAY_COMP (pluginGui->display), pluginGui->release); inv_display_comp_set_threshold(INV_DISPLAY_COMP (pluginGui->display), pluginGui->threshold); inv_display_comp_set_ratio(INV_DISPLAY_COMP (pluginGui->display), pluginGui->ratio); inv_display_comp_set_gain(INV_DISPLAY_COMP (pluginGui->display), pluginGui->gain); inv_knob_set_bypass(INV_KNOB (pluginGui->knobRms), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobRms), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobRms), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobRms), INV_KNOB_MARKINGS_CUST10); inv_knob_set_units(INV_KNOB (pluginGui->knobRms), ""); inv_knob_set_custom(INV_KNOB (pluginGui->knobRms), 0, "Peak"); inv_knob_set_custom(INV_KNOB (pluginGui->knobRms), 1, "Fast RMS"); inv_knob_set_custom(INV_KNOB (pluginGui->knobRms), 2, "RMS"); inv_knob_set_min(INV_KNOB (pluginGui->knobRms), 0.0); inv_knob_set_max(INV_KNOB (pluginGui->knobRms), 1.0); inv_knob_set_value(INV_KNOB (pluginGui->knobRms), pluginGui->rms); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobRms), "Description: This knob controls the smoothing on the input signal the compressor performs.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobRms),"motion-notify-event",G_CALLBACK(on_inv_comp_rms_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobAttack), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobAttack), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobAttack), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobAttack), INV_KNOB_MARKINGS_5); inv_knob_set_human(INV_KNOB (pluginGui->knobAttack)); inv_knob_set_units(INV_KNOB (pluginGui->knobAttack), "s"); inv_knob_set_min(INV_KNOB (pluginGui->knobAttack), 0.00001); inv_knob_set_max(INV_KNOB (pluginGui->knobAttack), 0.750); inv_knob_set_value(INV_KNOB (pluginGui->knobAttack), pluginGui->attack); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobAttack), "Description: This knob sets the attack of the envelope which controls how well the compressor follows rising signals.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobAttack),"motion-notify-event",G_CALLBACK(on_inv_comp_attack_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobRelease), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobRelease), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobRelease), INV_KNOB_CURVE_LOG); inv_knob_set_markings(INV_KNOB (pluginGui->knobRelease), INV_KNOB_MARKINGS_5); inv_knob_set_human(INV_KNOB (pluginGui->knobRelease)); inv_knob_set_units(INV_KNOB (pluginGui->knobRelease), "s"); inv_knob_set_min(INV_KNOB (pluginGui->knobRelease), 0.001); inv_knob_set_max(INV_KNOB (pluginGui->knobRelease), 5.0); inv_knob_set_value(INV_KNOB (pluginGui->knobRelease), pluginGui->release); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobRelease), "Description: This knob sets the release of the envelope which controls how well the compressor follows falling signals.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobRelease),"motion-notify-event",G_CALLBACK(on_inv_comp_release_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobThreshold), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobThreshold), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobThreshold), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobThreshold), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobThreshold), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobThreshold), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobThreshold), -36.0); inv_knob_set_max(INV_KNOB (pluginGui->knobThreshold), 0.0); inv_knob_set_value(INV_KNOB (pluginGui->knobThreshold), pluginGui->threshold); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobThreshold), "Description: This knob sets the threshold at which the compressor starts affecting the signal.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobThreshold),"motion-notify-event",G_CALLBACK(on_inv_comp_threshold_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobRatio), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobRatio), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobRatio), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobRatio), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobRatio), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobRatio), ":1"); inv_knob_set_min(INV_KNOB (pluginGui->knobRatio), 1.0); inv_knob_set_max(INV_KNOB (pluginGui->knobRatio), 20.0); inv_knob_set_value(INV_KNOB (pluginGui->knobRatio), pluginGui->ratio); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobRatio), "Description: This knob sets the compression ratio for signals that have exceeded the threshold.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobRatio),"motion-notify-event",G_CALLBACK(on_inv_comp_ratio_knob_motion),pluginGui); inv_knob_set_bypass(INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_knob_set_size(INV_KNOB (pluginGui->knobGain), INV_KNOB_SIZE_MEDIUM); inv_knob_set_curve(INV_KNOB (pluginGui->knobGain), INV_KNOB_CURVE_LINEAR); inv_knob_set_markings(INV_KNOB (pluginGui->knobGain), INV_KNOB_MARKINGS_5); inv_knob_set_highlight(INV_KNOB (pluginGui->knobGain), INV_KNOB_HIGHLIGHT_L); inv_knob_set_units(INV_KNOB (pluginGui->knobGain), "dB"); inv_knob_set_min(INV_KNOB (pluginGui->knobGain), -6.0); inv_knob_set_max(INV_KNOB (pluginGui->knobGain), 36.0); inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); inv_knob_set_tooltip(INV_KNOB (pluginGui->knobGain), "Description: This knob sets the output or markup gain of the compressor.\nUsage: Click and drag vertically to change value, hortizontally to change the sensitvity."); g_signal_connect_after(G_OBJECT(pluginGui->knobGain),"motion-notify-event",G_CALLBACK(on_inv_comp_gain_knob_motion),pluginGui); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF, "Off"); inv_switch_toggle_set_value( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 1.0); inv_switch_toggle_set_colour(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, 0.0, 1.0, 0.0); inv_switch_toggle_set_text( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON, "Active"); inv_switch_toggle_set_state( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON); inv_switch_toggle_set_tooltip(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), "Description: This switch activates soft-clipping on the output. The soft clipping function outputs a value between -3dB and 0dB for input values between -3dB and +infinity.\nUsage: Click to toggle between values."); g_signal_connect_after(G_OBJECT(pluginGui->toggleNoClip),"button-release-event",G_CALLBACK(on_inv_comp_noClip_toggle_button_release),pluginGui); inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),0.0); inv_lamp_set_scale(INV_LAMP (pluginGui->lampNoClip),3.0); inv_lamp_set_tooltip(INV_LAMP (pluginGui->lampNoClip), "This glows when soft clipping is occurring."); /* strip the parent window from the design so the host can attach its own */ gtk_widget_ref(pluginGui->windowContainer); gtk_container_remove(GTK_CONTAINER(window), pluginGui->windowContainer); *widget = (LV2UI_Widget) pluginGui->windowContainer; g_object_unref (G_OBJECT (builder)); /* return the instance */ return pluginGui; } static void cleanupICompGui(LV2UI_Handle ui) { return; } static void port_eventICompGui(LV2UI_Handle ui, uint32_t port, uint32_t buffer_size, uint32_t format, const void* buffer) { ICompGui *pluginGui = (ICompGui *)ui; float value; if(format==0) { value=* (float *) buffer; switch(port) { case ICOMP_BYPASS: pluginGui->bypass=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_OFF); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterGR), INV_PLUGIN_ACTIVE); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_ACTIVE); inv_display_comp_set_bypass( INV_DISPLAY_COMP (pluginGui->display), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRms), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobAttack), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRelease), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobThreshold),INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRatio), INV_PLUGIN_ACTIVE); inv_knob_set_bypass( INV_KNOB (pluginGui->knobGain), INV_PLUGIN_ACTIVE); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_ACTIVE); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleBypass), INV_SWITCH_TOGGLE_ON); inv_meter_set_bypass( INV_METER (pluginGui->meterIn), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterGR), INV_PLUGIN_BYPASS); inv_meter_set_bypass( INV_METER (pluginGui->meterOut), INV_PLUGIN_BYPASS); inv_display_comp_set_bypass( INV_DISPLAY_COMP (pluginGui->display), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRms), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobAttack), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRelease), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobThreshold),INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobRatio), INV_PLUGIN_BYPASS); inv_knob_set_bypass( INV_KNOB (pluginGui->knobGain), INV_PLUGIN_BYPASS); inv_switch_toggle_set_bypass( INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_PLUGIN_BYPASS); } gtk_widget_queue_draw (pluginGui->windowContainer); break; case ICOMP_RMS: pluginGui->rms=value; inv_knob_set_value(INV_KNOB (pluginGui->knobRms), pluginGui->rms); inv_display_comp_set_rms(INV_DISPLAY_COMP (pluginGui->display), pluginGui->rms); break; case ICOMP_ATTACK: pluginGui->attack=value; inv_knob_set_value(INV_KNOB (pluginGui->knobAttack), pluginGui->attack); inv_display_comp_set_attack(INV_DISPLAY_COMP (pluginGui->display), pluginGui->attack); break; case ICOMP_RELEASE: pluginGui->release=value; inv_knob_set_value(INV_KNOB (pluginGui->knobRelease), pluginGui->release); inv_display_comp_set_release(INV_DISPLAY_COMP (pluginGui->display), pluginGui->release); break; case ICOMP_THRESH: pluginGui->threshold=value; inv_knob_set_value(INV_KNOB (pluginGui->knobThreshold), pluginGui->threshold); inv_display_comp_set_threshold(INV_DISPLAY_COMP (pluginGui->display), pluginGui->threshold); break; case ICOMP_RATIO: pluginGui->ratio=value; inv_knob_set_value(INV_KNOB (pluginGui->knobRatio), pluginGui->ratio); inv_display_comp_set_ratio(INV_DISPLAY_COMP (pluginGui->display), pluginGui->ratio); break; case ICOMP_GAIN: pluginGui->gain=value; inv_knob_set_value(INV_KNOB (pluginGui->knobGain), pluginGui->gain); inv_display_comp_set_gain(INV_DISPLAY_COMP (pluginGui->display), pluginGui->gain); break; case ICOMP_NOCLIP: pluginGui->noClip=value; if(value <= 0.0) { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_OFF); } else { inv_switch_toggle_set_state(INV_SWITCH_TOGGLE (pluginGui->toggleNoClip), INV_SWITCH_TOGGLE_ON); } break; case ICOMP_METER_GR: inv_meter_set_LdB(INV_METER (pluginGui->meterGR),value); break; case ICOMP_METER_INL: inv_meter_set_LdB(INV_METER (pluginGui->meterIn),value); break; case ICOMP_METER_INR: if(pluginGui->InChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterIn),value); break; case ICOMP_METER_OUTL: inv_meter_set_LdB(INV_METER (pluginGui->meterOut),value); break; case ICOMP_METER_OUTR: if(pluginGui->OutChannels==2) inv_meter_set_RdB(INV_METER (pluginGui->meterOut),value); break; case ICOMP_METER_DRIVE: inv_lamp_set_value(INV_LAMP (pluginGui->lampNoClip),value); break; } } } static void init() { ICompGuiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); ICompGuiDescriptor->URI = ICOMP_GUI_URI; ICompGuiDescriptor->instantiate = instantiateICompGui; ICompGuiDescriptor->cleanup = cleanupICompGui; ICompGuiDescriptor->port_event = port_eventICompGui; ICompGuiDescriptor->extension_data = NULL; } const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { if (!ICompGuiDescriptor) init(); switch (index) { case 0: return ICompGuiDescriptor; default: return NULL; } } /*****************************************************************************/ static void on_inv_comp_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->bypass=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_BYPASS, 4, 0, &pluginGui->bypass); return; } static void on_inv_comp_rms_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->rms=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_RMS, 4, 0, &pluginGui->rms); return; } static void on_inv_comp_attack_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->attack=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_ATTACK, 4, 0, &pluginGui->attack); return; } static void on_inv_comp_release_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->release=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_RELEASE, 4, 0, &pluginGui->release); return; } static void on_inv_comp_threshold_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->threshold=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_THRESH, 4, 0, &pluginGui->threshold); return; } static void on_inv_comp_ratio_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->ratio=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_RATIO, 4, 0, &pluginGui->ratio); return; } static void on_inv_comp_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->gain=inv_knob_get_value(INV_KNOB (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_GAIN, 4, 0, &pluginGui->gain); return; } static void on_inv_comp_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data) { ICompGui *pluginGui = (ICompGui *) data; pluginGui->noClip=inv_switch_toggle_get_value(INV_SWITCH_TOGGLE (widget)); (*pluginGui->write_function)(pluginGui->controller, ICOMP_NOCLIP, 4, 0, &pluginGui->noClip); return; } invada-studio-plugins-lv2-1.2.0/plugingui/inv_compressor_gui.h0000664000175000017500000000276011251515772024426 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static void on_inv_comp_bypass_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_rms_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_attack_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_release_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_threshold_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_ratio_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_gain_knob_motion(GtkWidget *widget, GdkEvent *event, gpointer data); static void on_inv_comp_noClip_toggle_button_release(GtkWidget *widget, GdkEvent *event, gpointer data); invada-studio-plugins-lv2-1.2.0/plugingui/Makefile0000664000175000017500000000442211251515772021776 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # GENERAL CC = gcc LD = gcc CFLAGS = -I. `pkg-config --cflags cairo gtk+-2.0` -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC LDFLAGS = -shared -Lwidgets -L../plugin/library -lc -lm -linv_widgets -linv_common `pkg-config --libs cairo gtk+-2.0` -fPIC -DPIC GUIS = inv_compressor_gui.so \ inv_delay_gui.so \ inv_erreverb_gui.so \ inv_filter_gui.so \ inv_input_gui.so \ inv_meter_gui.so \ inv_phaser_gui.so \ inv_testtone_gui.so \ inv_tube_gui.so \ all: $(GUIS) # RULES TO BUILD GUIS FROM C CODE inv_compressor_gui.so: inv_compressor_gui.o ../plugin/inv_compressor.h inv_compressor_gui.h inv_delay_gui.so: inv_delay_gui.o ../plugin/inv_delay.h inv_delay_gui.h inv_erreverb_gui.so: inv_erreverb_gui.o ../plugin/inv_erreverb.h inv_erreverb_gui.h inv_filter_gui.so: inv_filter_gui.o ../plugin/inv_filter.h inv_filter_gui.h inv_input_gui.so: inv_input_gui.o ../plugin/inv_input.h inv_input_gui.h inv_meter_gui.so: inv_meter_gui.o ../plugin/inv_meter.h inv_meter_gui.h inv_phaser_gui.so: inv_phaser_gui.o ../plugin/inv_phaser.h inv_phaser_gui.h inv_testtone_gui.so: inv_testtone_gui.o ../plugin/inv_testtone.h inv_testtone_gui.h inv_tube_gui.so: inv_tube_gui.o ../plugin/inv_tube.h inv_tube_gui.h # OTHER TARGETS targets: $(GUIS) always: clean: -rm -f *.so -rm -f *.o -rm -f *~ %.o: %.c @echo "Compiling $<" @$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ %.so: %.o @echo "Creating $@" @$(LD) -o $@ $< $(LDFLAGS) invada-studio-plugins-lv2-1.2.0/COPYING0000664000175000017500000004311011251515772017363 0ustar alessioalessio GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. invada-studio-plugins-lv2-1.2.0/plugin/0000775000175000017500000000000011251515772017627 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/plugin/inv_phaser.h0000664000175000017500000000334611251515772022144 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IPHASER_GUI_URI "http://invadarecords.com/plugins/lv2/phaser/gui" #define IPHASER_MONO_URI "http://invadarecords.com/plugins/lv2/phaser/mono" #define IPHASER_STEREO_URI "http://invadarecords.com/plugins/lv2/phaser/stereo" #define IPHASER_SUM_URI "http://invadarecords.com/plugins/lv2/phaser/sum" #define IPHASER_BYPASS 0 #define IPHASER_CYCLE 1 #define IPHASER_PHASE 2 #define IPHASER_WIDTH 3 #define IPHASER_DEPTH 4 #define IPHASER_NOCLIP 5 #define IPHASER_LAMP_NOCLIP 6 #define IPHASER_LAMP_L 7 #define IPHASER_LAMP_R 8 #define IPHASER_AUDIO_OUTL 9 #define IPHASER_AUDIO_OUTR 10 #define IPHASER_METER_OUTL 11 #define IPHASER_METER_OUTR 12 #define IPHASER_AUDIO_INL 13 #define IPHASER_METER_INL 14 #define IPHASER_AUDIO_INR 15 /* not used in mono in mode */ #define IPHASER_METER_INR 16 /* not used in mono in mode */ #define PHASER_SPACE_SIZE 45 /* size in milli seconds */ /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_testtone.c0000664000175000017500000001534211251515772022521 0ustar alessioalessio/* This LV2 plugin provides a tone generator (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "library/common.h" #include "inv_testtone.h" static LV2_Descriptor *IToneDescriptor = NULL; typedef struct { /* Ports */ float *ControlActive; float *ControlFreq; float *ControlTrim; float *AudioOutputBuffer; float *MeterOutput; /* stuff we need to remember to reduce cpu */ double SampleRate; struct Envelope EnvAD[4]; /* stuff we need to remember to reduce cpu */ float LastActive; float LastFreq; float LastTrim; float ConvertedActive; float ConvertedFreq; float ConvertedTrim; float AngleLast; float EnvOutLast; } ITone; static LV2_Handle instantiateITone(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { ITone *plugin = (ITone *)malloc(sizeof(ITone)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; return (LV2_Handle)plugin; } static void connectPortITone(LV2_Handle instance, uint32_t port, void *data) { ITone *plugin = (ITone *)instance; switch (port) { case ITONE_ACTIVE: plugin->ControlActive = data; break; case ITONE_FREQ: plugin->ControlFreq = data; break; case ITONE_TRIM: plugin->ControlTrim = data; break; case ITONE_AUDIO_OUT: plugin->AudioOutputBuffer = data; break; case ITONE_METER_OUT: plugin->MeterOutput = data; break; } } static void activateITone(LV2_Handle instance) { ITone *plugin = (ITone *)instance; // these values force the conversion to take place plugin->LastActive = 0; plugin->LastFreq = 1000.00; plugin->LastTrim = 0.0; plugin->AngleLast = 0.0; plugin->EnvOutLast = 0.0; plugin->ConvertedActive = convertParam(ITONE_ACTIVE, plugin->LastActive, plugin->SampleRate); plugin->ConvertedFreq = convertParam(ITONE_FREQ, plugin->LastFreq, plugin->SampleRate); plugin->ConvertedTrim = convertParam(ITONE_TRIM, plugin->LastTrim, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runITone(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioOutput; float fActive,fAngleDelta,fTrim,fAngle; double fFreqDelta,fTrimDelta; int HasDelta; float fAudio; float EnvOut; uint32_t lSampleIndex; ITone *plugin = (ITone *)instance; pParamFunc = &convertParam; checkParamChange(ITONE_ACTIVE, plugin->ControlActive, &(plugin->LastActive), &(plugin->ConvertedActive), plugin->SampleRate, pParamFunc); fFreqDelta = getParamChange(ITONE_FREQ, plugin->ControlFreq, &(plugin->LastFreq), &(plugin->ConvertedFreq), plugin->SampleRate, pParamFunc); fTrimDelta = getParamChange(ITONE_TRIM, plugin->ControlTrim, &(plugin->LastTrim), &(plugin->ConvertedTrim), plugin->SampleRate, pParamFunc); fActive = plugin->ConvertedActive; if(fFreqDelta == 0 && fTrimDelta==0) { HasDelta =0; fAngleDelta = plugin->ConvertedFreq; fTrim = plugin->ConvertedTrim; } else { HasDelta=1; fAngleDelta = plugin->ConvertedFreq - fFreqDelta; fTrim = plugin->ConvertedTrim - fTrimDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fFreqDelta = fFreqDelta/(float)SampleCount; fTrimDelta = fTrimDelta/(float)SampleCount; } } pfAudioOutput = plugin->AudioOutputBuffer; fAngle = plugin->AngleLast; EnvOut = plugin->EnvOutLast; if(fActive==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { fAudio=fTrim*sin(fAngle); fAngle+=fAngleDelta; if(fAngle > PI) { fAngle -= PI_2; } *(pfAudioOutput++) = fAudio; //evelope on in and out for meters EnvOut += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudio, EnvOut); //update any changing parameters if(HasDelta==1) { fAngleDelta += fFreqDelta; fTrim += fTrimDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutput++) = 0.0; } //evelope on in and out for meters EnvOut =0; } // store values for next loop plugin->AngleLast = fAngle; plugin->EnvOutLast = (fabs(EnvOut)<1.0e-10) ? 0.f : EnvOut; // update the meters *(plugin->MeterOutput)=(EnvOut > 0.001) ? 20*log10(EnvOut) : -90.0; } static void cleanupITone(LV2_Handle instance) { free(instance); } static void init() { IToneDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IToneDescriptor->URI = ITONE_URI; IToneDescriptor->activate = activateITone; IToneDescriptor->cleanup = cleanupITone; IToneDescriptor->connect_port = connectPortITone; IToneDescriptor->deactivate = NULL; IToneDescriptor->instantiate = instantiateITone; IToneDescriptor->run = runITone; IToneDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IToneDescriptor) init(); switch (index) { case 0: return IToneDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case ITONE_ACTIVE: if(value<=0.0) result= 0; else result= 1; break; case ITONE_FREQ: if(value < 20.0) result= PI_2*20.0/(float)sr; else if (value < 20000) result= PI_2*value/(float)sr; else result= PI_2*20000.0/(float)sr; break; case ITONE_TRIM: if(value<-24.0) result= pow(10, -24.0/20.0); else if (value < 0.0) result= pow(10, value/20.0); else result= 1.0; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_tube.h0000664000175000017500000000302111251515772021607 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ITUBE_GUI_URI "http://invadarecords.com/plugins/lv2/tube/gui" #define ITUBE_MONO_URI "http://invadarecords.com/plugins/lv2/tube/mono" #define ITUBE_STEREO_URI "http://invadarecords.com/plugins/lv2/tube/stereo" #define ITUBE_BYPASS 0 #define ITUBE_DRIVE 1 #define ITUBE_DCOFFSET 2 #define ITUBE_PHASE 3 #define ITUBE_MIX 4 #define ITUBE_METER_DRIVE 5 #define ITUBE_METER_INL 6 #define ITUBE_METER_OUTL 7 #define ITUBE_AUDIO_INL 8 #define ITUBE_AUDIO_OUTL 9 #define ITUBE_METER_INR 10 /* not used in mono mode */ #define ITUBE_METER_OUTR 11 /* not used in mono mode */ #define ITUBE_AUDIO_INR 12 /* not used in mono mode */ #define ITUBE_AUDIO_OUTR 13 /* not used in mono mode */ /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_delay.h0000664000175000017500000000346711251515772021764 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IDELAY_GUI_URI "http://invadarecords.com/plugins/lv2/delay/gui" #define IDELAY_MONO_URI "http://invadarecords.com/plugins/lv2/delay/mono" #define IDELAY_SUM_URI "http://invadarecords.com/plugins/lv2/delay/sum" #define IDELAY_BYPASS 0 #define IDELAY_MODE 1 #define IDELAY_MUNGEMODE 2 #define IDELAY_MUNGE 3 #define IDELAY_LFO_CYCLE 4 #define IDELAY_LFO_WIDTH 5 #define IDELAY_1_DELAY 6 #define IDELAY_1_FB 7 #define IDELAY_1_PAN 8 #define IDELAY_1_VOL 9 #define IDELAY_2_DELAY 10 #define IDELAY_2_FB 11 #define IDELAY_2_PAN 12 #define IDELAY_2_VOL 13 #define IDELAY_METER_INL 14 #define IDELAY_METER_OUTL 15 #define IDELAY_METER_OUTR 16 #define IDELAY_LAMP_LFO 17 #define IDELAY_AUDIO_INL 18 #define IDELAY_AUDIO_OUTL 19 #define IDELAY_AUDIO_OUTR 20 #define IDELAY_AUDIO_INR 21 /* not used in mono in mode */ #define IDELAY_SPACE_SIZE 2501 /* size in milli seconds */ /* control conversion function */ float convertParam(unsigned long param, float value, double sr); /* munge conversion */ float convertMunge(unsigned int mode, float munge, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_filter.h0000664000175000017500000000333711251515772022147 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IFILTER_GUI_URI "http://invadarecords.com/plugins/lv2/filter/gui" #define IFILTER_MONO_LPF_URI "http://invadarecords.com/plugins/lv2/filter/lpf/mono" #define IFILTER_MONO_HPF_URI "http://invadarecords.com/plugins/lv2/filter/hpf/mono" #define IFILTER_STEREO_LPF_URI "http://invadarecords.com/plugins/lv2/filter/lpf/stereo" #define IFILTER_STEREO_HPF_URI "http://invadarecords.com/plugins/lv2/filter/hpf/stereo" #define IFILTER_BYPASS 0 #define IFILTER_FREQ 1 #define IFILTER_GAIN 2 #define IFILTER_NOCLIP 3 #define IFILTER_METER_INL 4 #define IFILTER_METER_OUTL 5 #define IFILTER_AUDIO_INL 6 #define IFILTER_AUDIO_OUTL 7 #define IFILTER_METER_DRIVE 8 #define IFILTER_METER_INR 9 /* not used in mono mode */ #define IFILTER_METER_OUTR 10 /* not used in mono mode */ #define IFILTER_AUDIO_INR 11 /* not used in mono mode */ #define IFILTER_AUDIO_OUTR 12 /* not used in mono mode */ /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_filter.c0000664000175000017500000005525211251515772022145 0ustar alessioalessio/* This LV2 plugin provides mono and stereo filters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "library/common.h" #include "inv_filter.h" static LV2_Descriptor *IFilterMonoLPFDescriptor = NULL; static LV2_Descriptor *IFilterStereoLPFDescriptor = NULL; static LV2_Descriptor *IFilterMonoHPFDescriptor = NULL; static LV2_Descriptor *IFilterStereoHPFDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *ControlFreq; float *ControlGain; float *ControlNoClip; float *AudioInputBufferL; float *AudioOutputBufferL; float *AudioInputBufferR; float *AudioOutputBufferR; float *MeterInputL; float *MeterOutputL; float *MeterInputR; float *MeterOutputR; float *MeterDrive; double SampleRate; struct Envelope EnvAD[4]; /* stuff we need to remember */ float LastBypass; float LastFreq; float LastGain; float LastNoClip; float ConvertedBypass; float ConvertedFreq; float ConvertedGain; float ConvertedNoClip; /* stuff we need to remember between calls */ float AudioLLast; float AudioRLast; float EnvInLLast; float EnvOutLLast; float EnvInRLast; float EnvOutRLast; float EnvDriveLast; } IFilter; static LV2_Handle instantiateIFilter(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IFilter *plugin = (IFilter *)malloc(sizeof(IFilter)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; return (LV2_Handle)plugin; } static void connectPortIFilter(LV2_Handle instance, uint32_t port, void *data) { IFilter *plugin = (IFilter *)instance; switch (port) { case IFILTER_BYPASS: plugin->ControlBypass = data; break; case IFILTER_FREQ: plugin->ControlFreq = data; break; case IFILTER_GAIN: plugin->ControlGain = data; break; case IFILTER_NOCLIP: plugin->ControlNoClip = data; break; case IFILTER_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IFILTER_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IFILTER_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IFILTER_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IFILTER_METER_INL: plugin->MeterInputL = data; break; case IFILTER_METER_INR: plugin->MeterInputR = data; break; case IFILTER_METER_OUTL: plugin->MeterOutputL = data; break; case IFILTER_METER_OUTR: plugin->MeterOutputR = data; break; case IFILTER_METER_DRIVE: plugin->MeterDrive = data; break; } } static void activateIFilter(LV2_Handle instance) { IFilter *plugin = (IFilter *)instance; plugin->AudioLLast = 0; plugin->AudioRLast = 0; plugin->EnvInLLast = 0; plugin->EnvOutLLast = 0; plugin->EnvInRLast = 0; plugin->EnvOutRLast = 0; plugin->EnvDriveLast = 0; /* defaults */ plugin->LastBypass = 0; plugin->LastFreq = 1000; plugin->LastGain = 0; plugin->LastNoClip = 0; plugin->ConvertedBypass = convertParam(IFILTER_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedFreq = convertParam(IFILTER_FREQ, plugin->LastFreq, plugin->SampleRate); plugin->ConvertedGain = convertParam(IFILTER_GAIN, plugin->LastGain, plugin->SampleRate); plugin->ConvertedNoClip = convertParam(IFILTER_NOCLIP, plugin->LastNoClip, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoLPFIFilter(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float InL,OutL,EnvInL,EnvOutL,EnvDrive; float fBypass,fSamples,fGain,fNoClip; double fFreqDelta,fGainDelta; int HasDelta; float fAudioL,fAudioLSum; float drive=0; unsigned long lSampleIndex; IFilter *plugin = (IFilter *)instance; pParamFunc = &convertParam; checkParamChange(IFILTER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IFILTER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fFreqDelta = getParamChange(IFILTER_FREQ, plugin->ControlFreq, &(plugin->LastFreq), &(plugin->ConvertedFreq), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(IFILTER_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fFreqDelta == 0 && fGainDelta==0 ) { HasDelta=0; fSamples = plugin->ConvertedFreq; fGain = plugin->ConvertedGain; } else { HasDelta=1; fSamples = plugin->ConvertedFreq - fFreqDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fFreqDelta = fFreqDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; fAudioLSum = plugin->AudioLLast; EnvInL = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); fAudioLSum = ((fSamples-1) * fAudioLSum + InL) / fSamples; fAudioL = fAudioLSum*fGain; OutL=fNoClip > 0 ? InoClip(fAudioL, &drive) : fAudioL; *(pfAudioOutputL++)= OutL; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive,EnvDrive); //update any changing parameters if(HasDelta==1) { fSamples += fFreqDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); } //evelope on in and out for meters fAudioLSum =0; EnvInL =0; EnvOutL =0; EnvDrive =0; } // remember for next time round plugin->AudioLLast = (fabs(fAudioLSum)<1.0e-10) ? 0.f : fAudioLSum; // and store values for next loop plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void runStereoLPFIFilter(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float InL,OutL,EnvInL,EnvOutL; float InR,OutR,EnvInR,EnvOutR; float fBypass,fSamples,fGain,fNoClip; double fFreqDelta,fGainDelta; int HasDelta; float fAudioL,fAudioR,fAudioLSum,fAudioRSum; float drive,EnvDrive; float driveL=0; float driveR=0; unsigned long lSampleIndex; IFilter *plugin = (IFilter *)instance; pParamFunc = &convertParam; checkParamChange(IFILTER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IFILTER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fFreqDelta = getParamChange(IFILTER_FREQ, plugin->ControlFreq, &(plugin->LastFreq), &(plugin->ConvertedFreq), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(IFILTER_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fFreqDelta == 0 && fGainDelta==0 ) { HasDelta=0; fSamples = plugin->ConvertedFreq; fGain = plugin->ConvertedGain; } else { HasDelta=1; fSamples = plugin->ConvertedFreq - fFreqDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fFreqDelta = fFreqDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fAudioLSum = plugin->AudioLLast; fAudioRSum = plugin->AudioRLast; EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); InR=*(pfAudioInputR++); fAudioLSum = ((fSamples-1) * fAudioLSum + InL) / fSamples; fAudioRSum = ((fSamples-1) * fAudioRSum + InR) / fSamples; fAudioL = fAudioLSum*fGain; fAudioR = fAudioRSum*fGain; OutL=fNoClip > 0 ? InoClip(fAudioL,&driveL) : fAudioL; OutR=fNoClip > 0 ? InoClip(fAudioR,&driveR) : fAudioR; *(pfAudioOutputL++)=OutL; *(pfAudioOutputR++)=OutR; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fSamples += fFreqDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //evelope on in and out for meters fAudioLSum =0; fAudioRSum =0; EnvInL =0; EnvInR =0; EnvOutL =0; EnvOutR =0; EnvDrive =0; } // store values for next loop plugin->AudioLLast = (fabs(fAudioLSum)<1.0e-10) ? 0.f : fAudioLSum; plugin->AudioRLast = (fabs(fAudioRSum)<1.0e-10) ? 0.f : fAudioRSum; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void runMonoHPFIFilter(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float InL,OutL,EnvInL,EnvOutL,EnvDrive; float fBypass,fSamples,fGain,fNoClip; double fFreqDelta,fGainDelta; int HasDelta; float fAudioL,fAudioLSum; float drive=0; unsigned long lSampleIndex; IFilter *plugin = (IFilter *)instance; pParamFunc = &convertParam; checkParamChange(IFILTER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IFILTER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fFreqDelta = getParamChange(IFILTER_FREQ, plugin->ControlFreq, &(plugin->LastFreq), &(plugin->ConvertedFreq), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(IFILTER_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fFreqDelta == 0 && fGainDelta==0 ) { HasDelta=0; fSamples = plugin->ConvertedFreq; fGain = plugin->ConvertedGain; } else { HasDelta=1; fSamples = plugin->ConvertedFreq - fFreqDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fFreqDelta = fFreqDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; fAudioLSum = plugin->AudioLLast; EnvInL = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); fAudioLSum = ((fSamples-1) * fAudioLSum + InL) / fSamples; fAudioL = (InL - fAudioLSum)*fGain; OutL=fNoClip > 0 ? InoClip(fAudioL,&drive) : fAudioL; *(pfAudioOutputL++)=OutL; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive,EnvDrive); //update any changing parameters if(HasDelta==1) { fSamples += fFreqDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); } //evelope on in and out for meters fAudioLSum =0; EnvInL =0; EnvOutL =0; EnvDrive =0; } // store values for next loop plugin->AudioLLast = (fabs(fAudioLSum)<1.0e-10) ? 0.f : fAudioLSum; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void runStereoHPFIFilter(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float InL,OutL,EnvInL,EnvOutL; float InR,OutR,EnvInR,EnvOutR; float fBypass,fSamples,fGain,fNoClip; double fFreqDelta,fGainDelta; int HasDelta; float fAudioL,fAudioR,fAudioLSum,fAudioRSum; float drive,EnvDrive; float driveL=0; float driveR=0; unsigned long lSampleIndex; IFilter *plugin = (IFilter *)instance; pParamFunc = &convertParam; checkParamChange(IFILTER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IFILTER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fFreqDelta = getParamChange(IFILTER_FREQ, plugin->ControlFreq, &(plugin->LastFreq), &(plugin->ConvertedFreq), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(IFILTER_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fFreqDelta == 0 && fGainDelta==0 ) { HasDelta=0; fSamples = plugin->ConvertedFreq; fGain = plugin->ConvertedGain; } else { HasDelta=1; fSamples = plugin->ConvertedFreq - fFreqDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fFreqDelta = fFreqDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fAudioLSum = plugin->AudioLLast; fAudioRSum = plugin->AudioRLast; EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL = *(pfAudioInputL++); InR = *(pfAudioInputR++); fAudioLSum = ((fSamples-1) * fAudioLSum + InL) / fSamples; fAudioRSum = ((fSamples-1) * fAudioRSum + InR) / fSamples; fAudioL = (InL - fAudioLSum)*fGain; fAudioR = (InR - fAudioRSum)*fGain; OutL=fNoClip > 0 ? InoClip(fAudioL,&driveL) : fAudioL; OutR=fNoClip > 0 ? InoClip(fAudioR,&driveR) : fAudioR; *(pfAudioOutputL++)=OutL; *(pfAudioOutputR++)=OutR; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fSamples += fFreqDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //evelope on in and out for meters fAudioLSum =0; fAudioRSum =0; EnvInL =0; EnvInR =0; EnvOutL =0; EnvOutR =0; EnvDrive =0; } // store values for next loop plugin->AudioLLast = (fabs(fAudioLSum)<1.0e-10) ? 0.f : fAudioLSum; plugin->AudioRLast = (fabs(fAudioRSum)<1.0e-10) ? 0.f : fAudioRSum; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void cleanupIFilter(LV2_Handle instance) { free(instance); } static void init() { IFilterMonoLPFDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IFilterMonoLPFDescriptor->URI = IFILTER_MONO_LPF_URI; IFilterMonoLPFDescriptor->activate = activateIFilter; IFilterMonoLPFDescriptor->cleanup = cleanupIFilter; IFilterMonoLPFDescriptor->connect_port = connectPortIFilter; IFilterMonoLPFDescriptor->deactivate = NULL; IFilterMonoLPFDescriptor->instantiate = instantiateIFilter; IFilterMonoLPFDescriptor->run = runMonoLPFIFilter; IFilterMonoLPFDescriptor->extension_data = NULL; IFilterStereoLPFDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IFilterStereoLPFDescriptor->URI = IFILTER_STEREO_LPF_URI; IFilterStereoLPFDescriptor->activate = activateIFilter; IFilterStereoLPFDescriptor->cleanup = cleanupIFilter; IFilterStereoLPFDescriptor->connect_port = connectPortIFilter; IFilterStereoLPFDescriptor->deactivate = NULL; IFilterStereoLPFDescriptor->instantiate = instantiateIFilter; IFilterStereoLPFDescriptor->run = runStereoLPFIFilter; IFilterStereoLPFDescriptor->extension_data = NULL; IFilterMonoHPFDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IFilterMonoHPFDescriptor->URI = IFILTER_MONO_HPF_URI; IFilterMonoHPFDescriptor->activate = activateIFilter; IFilterMonoHPFDescriptor->cleanup = cleanupIFilter; IFilterMonoHPFDescriptor->connect_port = connectPortIFilter; IFilterMonoHPFDescriptor->deactivate = NULL; IFilterMonoHPFDescriptor->instantiate = instantiateIFilter; IFilterMonoHPFDescriptor->run = runMonoHPFIFilter; IFilterMonoHPFDescriptor->extension_data = NULL; IFilterStereoHPFDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IFilterStereoHPFDescriptor->URI = IFILTER_STEREO_HPF_URI; IFilterStereoHPFDescriptor->activate = activateIFilter; IFilterStereoHPFDescriptor->cleanup = cleanupIFilter; IFilterStereoHPFDescriptor->connect_port = connectPortIFilter; IFilterStereoHPFDescriptor->deactivate = NULL; IFilterStereoHPFDescriptor->instantiate = instantiateIFilter; IFilterStereoHPFDescriptor->run = runStereoHPFIFilter; IFilterStereoHPFDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IFilterMonoLPFDescriptor) init(); switch (index) { case 0: return IFilterMonoLPFDescriptor; case 1: return IFilterStereoLPFDescriptor; case 2: return IFilterMonoHPFDescriptor; case 3: return IFilterStereoHPFDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IFILTER_FREQ: if (value < 20) result = sr/(40.0); else if (value <= 20000.0) result = sr/(2*value); else result=sr/(40000.0); break; case IFILTER_GAIN: if(value<0) result= 1; else if (value < 12) result = pow(10,value/20); else result= pow(10,0.6); break; case IFILTER_BYPASS: case IFILTER_NOCLIP: if(value<=0.0) result= 0; else result= 1; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_tube.c0000664000175000017500000003645711251515772021625 0ustar alessioalessio/* This LV2 plugin provides tube distortion (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "library/common.h" #include "inv_tube.h" static LV2_Descriptor *ITubeMonoDescriptor = NULL; static LV2_Descriptor *ITubeStereoDescriptor = NULL; typedef struct { float *ControlBypass; float *ControlDrive; float *ControlDcoffset; float *ControlPhase; float *ControlMix; float *AudioInputBufferL; float *AudioOutputBufferL; float *AudioInputBufferR; float *AudioOutputBufferR; float *MeterInputL; float *MeterOutputL; float *MeterInputR; float *MeterOutputR; float *MeterDrive; double SampleRate; struct Envelope EnvAD[4]; /* params get remembered */ float LastBypass; float LastDrive; float LastDcoffset; float LastPhase; float LastMix; float ConvertedBypass; float ConvertedDrive; float ConvertedDcoffset; float ConvertedPhase; float ConvertedMix; /* stuff we need to remember between calls */ float EnvInLLast; float EnvOutLLast; float EnvInRLast; float EnvOutRLast; float EnvDriveLast; } ITube; static LV2_Handle instantiateITube(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { ITube *plugin = (ITube *)malloc(sizeof(ITube)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; return (LV2_Handle)plugin; } static void connectPortITube(LV2_Handle instance, uint32_t port, void *data) { ITube *plugin = (ITube *)instance; switch (port) { case ITUBE_BYPASS: plugin->ControlBypass = data; break; case ITUBE_DRIVE: plugin->ControlDrive = data; break; case ITUBE_DCOFFSET: plugin->ControlDcoffset = data; break; case ITUBE_PHASE: plugin->ControlPhase = data; break; case ITUBE_MIX: plugin->ControlMix = data; break; case ITUBE_AUDIO_INL: plugin->AudioInputBufferL = data; break; case ITUBE_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case ITUBE_AUDIO_INR: plugin->AudioInputBufferR = data; break; case ITUBE_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case ITUBE_METER_INL: plugin->MeterInputL = data; break; case ITUBE_METER_INR: plugin->MeterInputR = data; break; case ITUBE_METER_OUTL: plugin->MeterOutputL = data; break; case ITUBE_METER_OUTR: plugin->MeterOutputR = data; break; case ITUBE_METER_DRIVE: plugin->MeterDrive = data; break; } } static void activateITube(LV2_Handle instance) { ITube *plugin = (ITube *)instance; /* set some defaults */ plugin->LastBypass=0; plugin->LastDrive=0; plugin->LastDcoffset=0; plugin->LastPhase=0; plugin->LastMix=75; plugin->EnvInLLast = 0; plugin->EnvOutLLast = 0; plugin->EnvInRLast = 0; plugin->EnvOutRLast = 0; plugin->EnvDriveLast = 0; plugin->ConvertedBypass = convertParam(ITUBE_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedDrive = convertParam(ITUBE_DRIVE, plugin->LastDrive, plugin->SampleRate); plugin->ConvertedDcoffset = convertParam(ITUBE_DCOFFSET, plugin->LastDcoffset, plugin->SampleRate); plugin->ConvertedPhase = convertParam(ITUBE_PHASE, plugin->LastPhase, plugin->SampleRate); plugin->ConvertedMix = convertParam(ITUBE_MIX, plugin->LastMix, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoITube(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float OutL,EnvInL,EnvOutL; float TubeOut,drive,EnvDrive; float fBypass,fAudioL, fDrive, fDCOffset, DCOffsetADJ, fPhase, fMix; double fDriveDelta,fDCDelta,fMixDelta; int HasDelta,HasTubeDelta; uint32_t lSampleIndex; ITube *plugin = (ITube *)instance; pParamFunc = &convertParam; /* check for any params changes */ checkParamChange(ITUBE_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(ITUBE_PHASE, plugin->ControlPhase, &(plugin->LastPhase), &(plugin->ConvertedPhase), plugin->SampleRate, pParamFunc); fDriveDelta = getParamChange(ITUBE_DRIVE, plugin->ControlDrive, &(plugin->LastDrive), &(plugin->ConvertedDrive), plugin->SampleRate, pParamFunc); fDCDelta = getParamChange(ITUBE_DCOFFSET, plugin->ControlDcoffset, &(plugin->LastDcoffset), &(plugin->ConvertedDcoffset), plugin->SampleRate, pParamFunc); fMixDelta = getParamChange(ITUBE_MIX, plugin->ControlMix, &(plugin->LastMix), &(plugin->ConvertedMix), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fPhase = plugin->ConvertedPhase; if(fDriveDelta == 0 && fDCDelta==0 && fMixDelta ==0) { HasDelta=0; HasTubeDelta=0; fDrive = plugin->ConvertedDrive; fDCOffset = plugin->ConvertedDcoffset; fMix = plugin->ConvertedMix; } else { HasDelta=1; fDrive = plugin->ConvertedDrive - fDriveDelta; fDCOffset = plugin->ConvertedDcoffset - fDCDelta; fMix = plugin->ConvertedMix - fMixDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fDriveDelta = fDriveDelta/(float)SampleCount; fDCDelta = fDCDelta/(float)SampleCount; fMixDelta = fMixDelta/(float)SampleCount; } if(fDriveDelta == 0 && fDCDelta==0) { HasTubeDelta=0; } else { HasTubeDelta=1; } } DCOffsetADJ=ITube_do(fDCOffset,fDrive); pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; EnvInL = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { fAudioL=*(pfAudioInputL++); TubeOut=ITube_do(fAudioL+fDCOffset,fDrive)-DCOffsetADJ; OutL= fPhase <= 0 ? (fAudioL*(1-fMix)) + TubeOut*fMix : (fAudioL*(1-fMix)) - TubeOut*fMix ; *(pfAudioOutputL++) = OutL; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioL, EnvInL); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); drive = fabs(fabs(fabs((fAudioL+fDCOffset)*fDrive) - fabs(fDCOffset*fDrive)) - fabs(TubeOut)); EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fMix += fMixDelta; if(HasTubeDelta==1) { fDrive += fDriveDelta; fDCOffset += fDCDelta; DCOffsetADJ=ITube_do(fDCOffset,fDrive); } } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); } //evelope on in and out for meters EnvInL =0; EnvOutL =0; EnvDrive =0; } // remember for next time round plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void runStereoITube(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float OutL,EnvInL,EnvOutL; float OutR,EnvInR,EnvOutR; float TubeOutL,TubeOutR,drive,EnvDrive; float driveL=0; float driveR=0; float fBypass,fAudioL, fAudioR, fDrive, fDCOffset, DCOffsetADJ, fPhase, fMix; double fDriveDelta,fDCDelta,fMixDelta; int HasDelta,HasTubeDelta; uint32_t lSampleIndex; ITube *plugin = (ITube *)instance; pParamFunc = &convertParam; /* check for any params changes */ checkParamChange(ITUBE_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(ITUBE_PHASE, plugin->ControlPhase, &(plugin->LastPhase), &(plugin->ConvertedPhase), plugin->SampleRate, pParamFunc); fDriveDelta = getParamChange(ITUBE_DRIVE, plugin->ControlDrive, &(plugin->LastDrive), &(plugin->ConvertedDrive), plugin->SampleRate, pParamFunc); fDCDelta = getParamChange(ITUBE_DCOFFSET, plugin->ControlDcoffset, &(plugin->LastDcoffset), &(plugin->ConvertedDcoffset), plugin->SampleRate, pParamFunc); fMixDelta = getParamChange(ITUBE_MIX, plugin->ControlMix, &(plugin->LastMix), &(plugin->ConvertedMix), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fPhase = plugin->ConvertedPhase; if(fDriveDelta == 0 && fDCDelta==0 && fMixDelta ==0) { HasDelta=0; HasTubeDelta=0; fDrive = plugin->ConvertedDrive; fDCOffset = plugin->ConvertedDcoffset; fMix = plugin->ConvertedMix; } else { HasDelta=1; fDrive = plugin->ConvertedDrive - fDriveDelta; fDCOffset = plugin->ConvertedDcoffset - fDCDelta; fMix = plugin->ConvertedMix - fMixDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fDriveDelta = fDriveDelta/(float)SampleCount; fDCDelta = fDCDelta/(float)SampleCount; fMixDelta = fMixDelta/(float)SampleCount; } if(fDriveDelta == 0 && fDCDelta==0) { HasTubeDelta=0; } else { HasTubeDelta=1; } } DCOffsetADJ=ITube_do(fDCOffset,fDrive); pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { fAudioL=*(pfAudioInputL++); TubeOutL=ITube_do(fAudioL+fDCOffset,fDrive)-DCOffsetADJ; OutL = fPhase <= 0 ? (fAudioL*(1-fMix)) + TubeOutL*fMix : (fAudioL*(1-fMix)) - TubeOutL*fMix ; *(pfAudioOutputL++) = OutL; fAudioR=*(pfAudioInputR++); TubeOutR=ITube_do(fAudioR+fDCOffset,fDrive)-DCOffsetADJ; OutR = fPhase <= 0 ? (fAudioR*(1-fMix)) + TubeOutR*fMix : (fAudioR*(1-fMix)) - TubeOutR*fMix ; *(pfAudioOutputR++) = OutR; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); driveL = fabs(fabs(fabs((fAudioL+fDCOffset)*fDrive) - fabs(fDCOffset*fDrive)) - fabs(TubeOutL)); driveR = fabs(fabs(fabs((fAudioR+fDCOffset)*fDrive) - fabs(fDCOffset*fDrive)) - fabs(TubeOutR)); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fMix += fMixDelta; if(HasTubeDelta==1) { fDrive += fDriveDelta; fDCOffset += fDCDelta; DCOffsetADJ=ITube_do(fDCOffset,fDrive); } } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //evelope on in and out for meters EnvInL =0; EnvInR =0; EnvOutL =0; EnvOutR =0; EnvDrive =0; } // store values for next loop plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; *(plugin->MeterDrive)=EnvDrive; } static void cleanupITube(LV2_Handle instance) { free(instance); } static void init() { ITubeMonoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); ITubeMonoDescriptor->URI = ITUBE_MONO_URI; ITubeMonoDescriptor->activate = activateITube; ITubeMonoDescriptor->cleanup = cleanupITube; ITubeMonoDescriptor->connect_port = connectPortITube; ITubeMonoDescriptor->deactivate = NULL; ITubeMonoDescriptor->instantiate = instantiateITube; ITubeMonoDescriptor->run = runMonoITube; ITubeMonoDescriptor->extension_data = NULL; ITubeStereoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); ITubeStereoDescriptor->URI = ITUBE_STEREO_URI; ITubeStereoDescriptor->activate = activateITube; ITubeStereoDescriptor->cleanup = cleanupITube; ITubeStereoDescriptor->connect_port = connectPortITube; ITubeStereoDescriptor->deactivate = NULL; ITubeStereoDescriptor->instantiate = instantiateITube; ITubeStereoDescriptor->run = runStereoITube; ITubeStereoDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!ITubeMonoDescriptor) init(); switch (index) { case 0: return ITubeMonoDescriptor; case 1: return ITubeStereoDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case ITUBE_DRIVE: if(value<0) result= 1; else if (value < 18) result = pow(10,value/20.0); else result= pow(10,0.9); break; case ITUBE_DCOFFSET: if(value<-1) result= -1; else if (value < 0) result = -pow(value,2); else if (value < 1) result = pow(value,2); else result= 1; break; case ITUBE_BYPASS: case ITUBE_PHASE: if(value<=0.0) result= 0; else result= 1; break; case ITUBE_MIX: if(value<0) result= 0; else if (value < 100) result = value/100; else result= 1; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_phaser.c0000664000175000017500000006736311251515772022150 0ustar alessioalessio/* This LV2 plugin provides phaser plugins (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "library/common.h" #include "inv_phaser.h" static LV2_Descriptor *IPhaserMonoDescriptor = NULL; static LV2_Descriptor *IPhaserStereoDescriptor = NULL; static LV2_Descriptor *IPhaserSumDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *ControlCycle; float *ControlPhase; float *ControlWidth; float *ControlDepth; float *ControlNoClip; float *AudioOutputBufferL; float *AudioOutputBufferR; float *AudioInputBufferL; float *AudioInputBufferR; float *MeterInputL; float *MeterInputR; float *MeterOutputL; float *MeterOutputR; float *LampLfoL; float *LampLfoR; float *LampNoClip; double SampleRate; float Offset; struct Envelope EnvAD[4]; /* Stuff to remember to avoid recalculating the delays every run */ float LastBypass; float LastCycle; float LastPhase; float LastWidth; float LastDepth; float LastNoClip; float AngleLast; float EnvInLLast; float EnvInRLast; float EnvOutLLast; float EnvOutRLast; float EnvDriveLast; float ConvertedBypass; float ConvertedCycle; float ConvertedPhase; float ConvertedWidth; float ConvertedDepth; float ConvertedNoClip; /* Delay Space Data */ unsigned long SpaceSize; float * SpaceL; float * SpaceR; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; } IPhaser; static LV2_Handle instantiateIPhaser(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IPhaser *plugin = (IPhaser *)malloc(sizeof(IPhaser)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; plugin->Offset = s_rate / 10000; /* 10khz wavelength */ plugin->SpaceSize = PHASER_SPACE_SIZE * s_rate / 1000; /* the delay space */ if((plugin->SpaceL = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; if((plugin->SpaceR = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; return (LV2_Handle)plugin; } static void connectPortIPhaser(LV2_Handle instance, uint32_t port, void *data) { IPhaser *plugin = (IPhaser *)instance; switch (port) { case IPHASER_BYPASS: plugin->ControlBypass = data; break; case IPHASER_CYCLE: plugin->ControlCycle = data; break; case IPHASER_PHASE: plugin->ControlPhase = data; break; case IPHASER_WIDTH: plugin->ControlWidth = data; break; case IPHASER_DEPTH: plugin->ControlDepth = data; break; case IPHASER_NOCLIP: plugin->ControlNoClip = data; break; case IPHASER_LAMP_L: plugin->LampLfoL = data; break; case IPHASER_LAMP_R: plugin->LampLfoR = data; break; case IPHASER_LAMP_NOCLIP: plugin->LampNoClip = data; break; case IPHASER_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IPHASER_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IPHASER_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IPHASER_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IPHASER_METER_INL: plugin->MeterInputL = data; break; case IPHASER_METER_INR: plugin->MeterInputR = data; break; case IPHASER_METER_OUTL: plugin->MeterOutputL = data; break; case IPHASER_METER_OUTR: plugin->MeterOutputR = data; break; } } static void activateIPhaser(LV2_Handle instance) { IPhaser *plugin = (IPhaser *)instance; unsigned long i; float * p; float * q; //set ourselves at the beginning of space plugin->SpaceLCur=plugin->SpaceL; plugin->SpaceRCur=plugin->SpaceR; // clear space p=plugin->SpaceL; q=plugin->SpaceR; for(i=0; i < plugin->SpaceSize; i++) { *(p++)=0; *(q++)=0; } plugin->SpaceLEnd=--p; plugin->SpaceREnd=--q; //set defaults plugin->LastBypass = 0.0; plugin->LastCycle = 25.0; plugin->LastPhase = 45.0; plugin->LastWidth = 10.5; plugin->LastDepth = 75.0; plugin->LastNoClip = 1.0; plugin->EnvInLLast = 0; plugin->EnvInRLast = 0; plugin->EnvOutLLast = 0; plugin->EnvOutRLast = 0; plugin->EnvDriveLast = 0; plugin->AngleLast = 0; plugin->ConvertedBypass = convertParam(IPHASER_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedCycle = convertParam(IPHASER_CYCLE, plugin->LastCycle, plugin->SampleRate); plugin->ConvertedPhase = convertParam(IPHASER_PHASE, plugin->LastPhase, plugin->SampleRate); plugin->ConvertedWidth = convertParam(IPHASER_WIDTH, plugin->LastWidth, plugin->SampleRate); plugin->ConvertedDepth = convertParam(IPHASER_DEPTH, plugin->LastDepth, plugin->SampleRate); plugin->ConvertedNoClip = convertParam(IPHASER_NOCLIP, plugin->LastNoClip, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoIPhaser(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float * pfAudioOutputR; float fOffset; float fAngle; float In,OutL,OutR; float EnvIn,EnvOutL,EnvOutR,EnvDrive; float drive; float driveL=0; float driveR=0; float fBypass,fAngleDelta,fRPhase,fMaxDelay2,fDepth,fNoClip; double fCycleDelta,fPhaseDelta,fWidthDelta,fDepthDelta; int HasDelta; float fDelayL,fDelayOffsetL; float fDelayR,fDelayOffsetR; unsigned long lDelaySampleL; unsigned long lDelaySampleR; unsigned long lSampleIndex; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IPhaser *plugin = (IPhaser *)instance; pParamFunc = &convertParam; /* check if any other params have changed */ checkParamChange(IPHASER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IPHASER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fCycleDelta = getParamChange(IPHASER_CYCLE, plugin->ControlCycle, &(plugin->LastCycle), &(plugin->ConvertedCycle), plugin->SampleRate, pParamFunc); fPhaseDelta = getParamChange(IPHASER_PHASE, plugin->ControlPhase, &(plugin->LastPhase), &(plugin->ConvertedPhase), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IPHASER_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); fDepthDelta = getParamChange(IPHASER_DEPTH, plugin->ControlDepth, &(plugin->LastDepth), &(plugin->ConvertedDepth), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fCycleDelta == 0 && fPhaseDelta==0 && fWidthDelta==0 && fDepthDelta==0) { HasDelta=0; fAngleDelta = plugin->ConvertedCycle; fRPhase = plugin->ConvertedPhase; fMaxDelay2 = plugin->ConvertedWidth; fDepth = plugin->ConvertedDepth; } else { HasDelta=1; fAngleDelta = plugin->ConvertedCycle - fCycleDelta; fRPhase = plugin->ConvertedPhase - fPhaseDelta; fMaxDelay2 = plugin->ConvertedWidth - fWidthDelta; fDepth = plugin->ConvertedDepth - fDepthDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fCycleDelta = fCycleDelta/(float)SampleCount; fPhaseDelta = fPhaseDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; fDepthDelta = fDepthDelta/(float)SampleCount; } } SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fOffset = plugin->Offset; fAngle = plugin->AngleLast; EnvIn = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { In=*(pfAudioInputL++); fDelayL=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle))); fDelayR=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle+fRPhase))); fAngle += fAngleDelta; lDelaySampleL=(unsigned long)fDelayL; lDelaySampleR=(unsigned long)fDelayR; fDelayOffsetL=fDelayL-(float)lDelaySampleL; fDelayOffsetR=fDelayR-(float)lDelaySampleR; // subtract from the delay space SpaceSub(SpaceLCur, SpaceLEnd, SpaceSize, lDelaySampleL, fDelayOffsetL, fDepth*In); SpaceSub(SpaceRCur, SpaceREnd, SpaceSize, lDelaySampleR, fDelayOffsetR, fDepth*In); // read the audio out of the delay space OutL = In + *(SpaceLCur); OutR = In + *(SpaceRCur); OutL = fNoClip > 0 ? InoClip(OutL,&driveL) : OutL; OutR = fNoClip > 0 ? InoClip(OutR,&driveR) : OutR; *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fAngleDelta += fCycleDelta; fRPhase += fPhaseDelta; fMaxDelay2 += fWidthDelta; fDepth += fDepthDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *pfAudioInputL; *(pfAudioOutputR++) = *(pfAudioInputL++); fAngle += fAngleDelta; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero envelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; EnvDrive=0; } while(fAngle > PI_2) { fAngle -= PI_2; } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->AngleLast = fAngle; plugin->EnvInLLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->LampNoClip)=EnvDrive; *(plugin->LampLfoL) = 1.75*(1+(cos(fAngle))); *(plugin->LampLfoR) = 1.75*(1+(cos(fAngle+fRPhase))); *(plugin->MeterInputL) =(EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void runStereoIPhaser(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float fOffset; float fAngle; float InL,InR,OutL,OutR; float EnvInL,EnvInR,EnvOutL,EnvOutR,EnvDrive; float drive; float driveL=0; float driveR=0; float fBypass,fAngleDelta,fRPhase,fMaxDelay2,fDepth,fNoClip; double fCycleDelta,fPhaseDelta,fWidthDelta,fDepthDelta; int HasDelta; float fDelayL,fDelayOffsetL; float fDelayR,fDelayOffsetR; unsigned long lDelaySampleL; unsigned long lDelaySampleR; unsigned long lSampleIndex; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IPhaser *plugin = (IPhaser *)instance; pParamFunc = &convertParam; /* check if any other params have changed */ checkParamChange(IPHASER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IPHASER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fCycleDelta = getParamChange(IPHASER_CYCLE, plugin->ControlCycle, &(plugin->LastCycle), &(plugin->ConvertedCycle), plugin->SampleRate, pParamFunc); fPhaseDelta = getParamChange(IPHASER_PHASE, plugin->ControlPhase, &(plugin->LastPhase), &(plugin->ConvertedPhase), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IPHASER_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); fDepthDelta = getParamChange(IPHASER_DEPTH, plugin->ControlDepth, &(plugin->LastDepth), &(plugin->ConvertedDepth), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fCycleDelta == 0 && fPhaseDelta==0 && fWidthDelta==0 && fDepthDelta==0) { HasDelta=0; fAngleDelta = plugin->ConvertedCycle; fRPhase = plugin->ConvertedPhase; fMaxDelay2 = plugin->ConvertedWidth; fDepth = plugin->ConvertedDepth; } else { HasDelta=1; fAngleDelta = plugin->ConvertedCycle - fCycleDelta; fRPhase = plugin->ConvertedPhase - fPhaseDelta; fMaxDelay2 = plugin->ConvertedWidth - fWidthDelta; fDepth = plugin->ConvertedDepth - fDepthDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fCycleDelta = fCycleDelta/(float)SampleCount; fPhaseDelta = fPhaseDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; fDepthDelta = fDepthDelta/(float)SampleCount; } } SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fOffset = plugin->Offset; fAngle = plugin->AngleLast; EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); InR=*(pfAudioInputR++); fDelayL=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle))); fDelayR=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle+fRPhase))); fAngle += fAngleDelta; lDelaySampleL=(unsigned long)fDelayL; lDelaySampleR=(unsigned long)fDelayR; fDelayOffsetL=fDelayL-(float)lDelaySampleL; fDelayOffsetR=fDelayR-(float)lDelaySampleR; // subtract from the delay space SpaceSub(SpaceLCur, SpaceLEnd, SpaceSize, lDelaySampleL, fDelayOffsetL, fDepth*InL); SpaceSub(SpaceRCur, SpaceREnd, SpaceSize, lDelaySampleR, fDelayOffsetR, fDepth*InR); // read the audio out of the delay space OutL = InL + *(SpaceLCur); OutR = InR + *(SpaceRCur); OutL = fNoClip > 0 ? InoClip(OutL,&driveL) : OutL; OutR = fNoClip > 0 ? InoClip(OutR,&driveR) : OutR; *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fAngleDelta += fCycleDelta; fRPhase += fPhaseDelta; fMaxDelay2 += fWidthDelta; fDepth += fDepthDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); fAngle += fAngleDelta; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero envelope on in and out for meters EnvInL =0; EnvInR =0; EnvOutL =0; EnvOutR =0; EnvDrive=0; } while(fAngle > PI_2) { fAngle -= PI_2; } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->AngleLast = fAngle; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->LampNoClip)=EnvDrive; *(plugin->LampLfoL) = 1.75*(1+(cos(fAngle))); *(plugin->LampLfoR) = 1.75*(1+(cos(fAngle+fRPhase))); *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void runSumIPhaser(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float fOffset; float fAngle; float In,OutL,OutR; float EnvIn,EnvOutL,EnvOutR,EnvDrive; float drive; float driveL=0; float driveR=0; float fBypass,fAngleDelta,fRPhase,fMaxDelay2,fDepth,fNoClip; double fCycleDelta,fPhaseDelta,fWidthDelta,fDepthDelta; int HasDelta; float fDelayL,fDelayOffsetL; float fDelayR,fDelayOffsetR; unsigned long lDelaySampleL; unsigned long lDelaySampleR; unsigned long lSampleIndex; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IPhaser *plugin = (IPhaser *)instance; pParamFunc = &convertParam; /* check if any other params have changed */ checkParamChange(IPHASER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IPHASER_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fCycleDelta = getParamChange(IPHASER_CYCLE, plugin->ControlCycle, &(plugin->LastCycle), &(plugin->ConvertedCycle), plugin->SampleRate, pParamFunc); fPhaseDelta = getParamChange(IPHASER_PHASE, plugin->ControlPhase, &(plugin->LastPhase), &(plugin->ConvertedPhase), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IPHASER_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); fDepthDelta = getParamChange(IPHASER_DEPTH, plugin->ControlDepth, &(plugin->LastDepth), &(plugin->ConvertedDepth), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fCycleDelta == 0 && fPhaseDelta==0 && fWidthDelta==0 && fDepthDelta==0) { HasDelta=0; fAngleDelta = plugin->ConvertedCycle; fRPhase = plugin->ConvertedPhase; fMaxDelay2 = plugin->ConvertedWidth; fDepth = plugin->ConvertedDepth; } else { HasDelta=1; fAngleDelta = plugin->ConvertedCycle - fCycleDelta; fRPhase = plugin->ConvertedPhase - fPhaseDelta; fMaxDelay2 = plugin->ConvertedWidth - fWidthDelta; fDepth = plugin->ConvertedDepth - fDepthDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fCycleDelta = fCycleDelta/(float)SampleCount; fPhaseDelta = fPhaseDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; fDepthDelta = fDepthDelta/(float)SampleCount; } } SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fOffset = plugin->Offset; fAngle = plugin->AngleLast; EnvIn = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { In=(*(pfAudioInputL++) + *(pfAudioInputR++))/2; fDelayL=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle))); fDelayR=fOffset + (fMaxDelay2 * ( 1 + cos(fAngle+fRPhase))); fAngle += fAngleDelta; lDelaySampleL=(unsigned long)fDelayL; lDelaySampleR=(unsigned long)fDelayR; fDelayOffsetL=fDelayL-(float)lDelaySampleL; fDelayOffsetR=fDelayR-(float)lDelaySampleR; // subtract from the delay space SpaceSub(SpaceLCur, SpaceLEnd, SpaceSize, lDelaySampleL, fDelayOffsetL, fDepth*In); SpaceSub(SpaceRCur, SpaceREnd, SpaceSize, lDelaySampleR, fDelayOffsetR, fDepth*In); // read the audio out of the delay space OutL = In + *(SpaceLCur); OutR = In + *(SpaceRCur); OutL = fNoClip > 0 ? InoClip(OutL,&driveL) : OutL; OutR = fNoClip > 0 ? InoClip(OutR,&driveR) : OutR; *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fAngleDelta += fCycleDelta; fRPhase += fPhaseDelta; fMaxDelay2 += fWidthDelta; fDepth += fDepthDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *pfAudioInputL; *(pfAudioOutputR++) = *(pfAudioInputL++); fAngle += fAngleDelta; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero envelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; EnvDrive=0; } while(fAngle > PI_2) { fAngle -= PI_2; } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->AngleLast = fAngle; plugin->EnvInLLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->LampNoClip)=EnvDrive; *(plugin->LampLfoL) = 1.75*(1+(cos(fAngle))); *(plugin->LampLfoR) = 1.75*(1+(cos(fAngle+fRPhase))); *(plugin->MeterInputL) =(EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void cleanupIPhaser(LV2_Handle instance) { IPhaser *plugin = (IPhaser *)instance; free(plugin->SpaceL); free(plugin->SpaceR); free(instance); } static void init() { IPhaserMonoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IPhaserMonoDescriptor->URI = IPHASER_MONO_URI; IPhaserMonoDescriptor->activate = activateIPhaser; IPhaserMonoDescriptor->cleanup = cleanupIPhaser; IPhaserMonoDescriptor->connect_port = connectPortIPhaser; IPhaserMonoDescriptor->deactivate = NULL; IPhaserMonoDescriptor->instantiate = instantiateIPhaser; IPhaserMonoDescriptor->run = runMonoIPhaser; IPhaserMonoDescriptor->extension_data = NULL; IPhaserStereoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IPhaserStereoDescriptor->URI = IPHASER_STEREO_URI; IPhaserStereoDescriptor->activate = activateIPhaser; IPhaserStereoDescriptor->cleanup = cleanupIPhaser; IPhaserStereoDescriptor->connect_port = connectPortIPhaser; IPhaserStereoDescriptor->deactivate = NULL; IPhaserStereoDescriptor->instantiate = instantiateIPhaser; IPhaserStereoDescriptor->run = runStereoIPhaser; IPhaserStereoDescriptor->extension_data = NULL; IPhaserSumDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IPhaserSumDescriptor->URI = IPHASER_SUM_URI; IPhaserSumDescriptor->activate = activateIPhaser; IPhaserSumDescriptor->cleanup = cleanupIPhaser; IPhaserSumDescriptor->connect_port = connectPortIPhaser; IPhaserSumDescriptor->deactivate = NULL; IPhaserSumDescriptor->instantiate = instantiateIPhaser; IPhaserSumDescriptor->run = runSumIPhaser; IPhaserSumDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IPhaserMonoDescriptor) init(); switch (index) { case 0: return IPhaserMonoDescriptor; case 1: return IPhaserStereoDescriptor; case 2: return IPhaserSumDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IPHASER_BYPASS: case IPHASER_NOCLIP: if(value<=0.0) result= 0; else result= 1; break; case IPHASER_CYCLE: if (value < 0.5) result = PI_2/(0.5*sr); else if (value <= 500.0) result = PI_2/(value * sr); else result = PI_2/(500.0 * sr); break; case IPHASER_PHASE: if(value<-180) result = -PI; else if (value < 180) result = value*PI/180.0; else result = PI; break; case IPHASER_WIDTH: if(value<1) result = sr/2000.0; else if (value < 15) result = value*sr/2000.0; else result = 15.0*sr/2000.0; break; case IPHASER_DEPTH: if(value<0) result = 0.0; else if (value < 100) result = value/100.0; else result = 1.0; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_input.h0000664000175000017500000000265311251515772022021 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IINPUT_URI "http://invadarecords.com/plugins/lv2/input"; #define IINPUT_GUI_URI "http://invadarecords.com/plugins/lv2/input/gui"; #define IINPUT_BYPASS 0 #define IINPUT_PHASEL 1 #define IINPUT_PHASER 2 #define IINPUT_GAIN 3 #define IINPUT_PAN 4 #define IINPUT_WIDTH 5 #define IINPUT_NOCLIP 6 #define IINPUT_AUDIO_INL 7 #define IINPUT_AUDIO_INR 8 #define IINPUT_AUDIO_OUTL 9 #define IINPUT_AUDIO_OUTR 10 #define IINPUT_METER_INL 11 #define IINPUT_METER_INR 12 #define IINPUT_METER_OUTL 13 #define IINPUT_METER_OUTR 14 #define IINPUT_METER_PHASE 15 #define IINPUT_METER_DRIVE 16 /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_erreverb.c0000664000175000017500000006572711251515772022504 0ustar alessioalessio/* This LV2 plugin provides an early reflection reverb from a mono source (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Some Notes: =========== This plugin is not your classic sort of reverb that makes long washy spaces. It simulates a room by calculating the early reflections that occur off the walls/roof etc. It's useful for: a) putting dry signals in a 'natural' space so they sit with sounds recorded with 'room' anbience in them. b) thickening strings, vocals etc without softening or washing out. c) as a singal preprocess for reverb that does not have early reflections. d) accurate stereo placement by setting the 'source' LR the same as any panning the dry signle has. This is because the early reflections from the off-center single reinforce the location of the sound rather than contradicting it as a normal reverb would do. Parameter description: RoomLength,RoomWidth,RoomHeight - the dimensions (in meters) of the room SourceLR, SourceFB (FB=Front/Back) - where the sound source is in the room (always the back half) DestLR, DestFB (FB=Front/Back) - where the destination (or listener) is in the room (always the front half) HPF - roll off some bottom end Warmth - roll off top end (amount depends on reflection count) Diffusion - makes the relections less perfect to simulate objects in the room. */ #include #include #include #include #include "library/common.h" #include "inv_erreverb.h" static LV2_Descriptor *IReverbERMonoDescriptor = NULL; static LV2_Descriptor *IReverbERSumDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *ControlRoomLength; float *ControlRoomWidth; float *ControlRoomHeight; float *ControlSourceLR; float *ControlSourceFB; float *ControlDestLR; float *ControlDestFB; float *ControlHPF; float *ControlWarmth; float *ControlDiffusion; float *AudioOutputBufferL; float *AudioOutputBufferR; float *AudioInputBufferL; float *AudioInputBufferR; float *MeterInput; float *MeterOutputL; float *MeterOutputR; double SampleRate; struct Envelope EnvAD[4]; /* Stuff to remember to avoid recalculating the delays every run */ float LastBypass; float LastRoomLength; float LastRoomWidth; float LastRoomHeight; float LastSourceLR; float LastSourceFB; float LastDestLR; float LastDestFB; float LastHPF; float LastWarmth; float LastDiffusion; float EnvInLast; float EnvOutLLast; float EnvOutRLast; float ConvertedBypass; float ConvertedHPF; float ConvertedWarmth; /* fade in flag */ int fadeIn; /* Delay and Reverb Space Data */ unsigned int er_size; struct ERunit * er; unsigned long SpaceSize; float * SpaceL; float * SpaceR; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; float AudioHPFLast; float AudioIn1Last; float AudioIn2Last; float AudioIn3Last; float AudioIn4Last; } IReverbER; static LV2_Handle instantiateIReverbER(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IReverbER *plugin = (IReverbER *)malloc(sizeof(IReverbER)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; plugin->SpaceSize = REVERB_SPACE_SIZE * s_rate; /* the delay space */ if((plugin->SpaceL = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; if((plugin->SpaceR = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; /* the delays */ if((plugin->er = (struct ERunit *)malloc(sizeof(struct ERunit) * MAX_ER))==NULL) return NULL; return (LV2_Handle)plugin; } static void connectPortIReverbER(LV2_Handle instance, uint32_t port, void *data) { IReverbER *plugin = (IReverbER *)instance; switch (port) { case IERR_BYPASS: plugin->ControlBypass = data; break; case IERR_ROOMLENGTH: plugin->ControlRoomLength = data; break; case IERR_ROOMWIDTH: plugin->ControlRoomWidth = data; break; case IERR_ROOMHEIGHT: plugin->ControlRoomHeight = data; break; case IERR_SOURCELR: plugin->ControlSourceLR = data; break; case IERR_SOURCEFB: plugin->ControlSourceFB = data; break; case IERR_DESTLR: plugin->ControlDestLR = data; break; case IERR_DESTFB: plugin->ControlDestFB = data; break; case IERR_HPF: plugin->ControlHPF = data; break; case IERR_WARMTH: plugin->ControlWarmth = data; break; case IERR_DIFFUSION: plugin->ControlDiffusion = data; break; case IERR_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IERR_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IERR_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IERR_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IERR_METER_IN: plugin->MeterInput = data; break; case IERR_METER_OUTL: plugin->MeterOutputL = data; break; case IERR_METER_OUTR: plugin->MeterOutputR = data; break; } } static void activateIReverbER(LV2_Handle instance) { IReverbER *plugin = (IReverbER *)instance; unsigned long i; float * p; float * q; //set ourselves at the beginning of space plugin->SpaceLCur=plugin->SpaceL; plugin->SpaceRCur=plugin->SpaceR; // clear space p=plugin->SpaceL; q=plugin->SpaceR; for(i=0; i < plugin->SpaceSize; i++) { *(p++)=0; *(q++)=0; } plugin->SpaceLEnd=--p; plugin->SpaceREnd=--q; //set defaults plugin->LastBypass = 0.0; plugin->LastRoomLength = 25.0; plugin->LastRoomWidth = 30.0; plugin->LastRoomHeight = 10; plugin->LastSourceLR = -0.01; plugin->LastSourceFB = 0.8; plugin->LastDestLR = 0.01; plugin->LastDestFB = 0.2; plugin->LastHPF = 1000.0; plugin->LastWarmth = 50; plugin->LastDiffusion = 50; plugin->fadeIn=0; plugin->AudioHPFLast=0; plugin->AudioIn1Last=0; plugin->AudioIn2Last=0; plugin->AudioIn3Last=0; plugin->AudioIn4Last=0; plugin->EnvInLast = 0; plugin->EnvOutLLast = 0; plugin->EnvOutRLast = 0; plugin->ConvertedBypass = convertParam(IERR_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedHPF = convertParam(IERR_HPF, plugin->LastHPF, plugin->SampleRate); plugin->ConvertedWarmth = convertParam(IERR_WARMTH, plugin->LastWarmth, plugin->SampleRate); calculateIReverbERWrapper(instance); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoIReverbER(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float * pfAudioOutputR; float In,EnvIn; float OutL,EnvOutL; float OutR,EnvOutR; float AudioIn,AudioHPF,AudioIn1,AudioIn2,AudioIn3,AudioIn4,AudioProc; float fBypass,HPFsamples,WarmthSamples; int fadeOut,fadeIn; float fadeVol; double fWarmthDelta,fHPFDelta; int HasDelta; struct ERunit * er; unsigned long lSampleIndex; unsigned int i; unsigned int er_size; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IReverbER *plugin = (IReverbER *)instance; pParamFunc = &convertParam; fadeIn=plugin->fadeIn; fadeOut=0; /* see if the room has changed and recalculate the reflection details if needed */ if(*(plugin->ControlRoomLength) != plugin->LastRoomLength || *(plugin->ControlRoomWidth) != plugin->LastRoomWidth || *(plugin->ControlRoomHeight) != plugin->LastRoomHeight || *(plugin->ControlSourceLR) != plugin->LastSourceLR || *(plugin->ControlSourceFB) != plugin->LastSourceFB || *(plugin->ControlDestLR) != plugin->LastDestLR || *(plugin->ControlDestFB) != plugin->LastDestFB || *(plugin->ControlDiffusion) != plugin->LastDiffusion ) { plugin->LastRoomLength = *(plugin->ControlRoomLength); plugin->LastRoomWidth = *(plugin->ControlRoomWidth); plugin->LastRoomHeight = *(plugin->ControlRoomHeight); plugin->LastSourceLR = *(plugin->ControlSourceLR); plugin->LastSourceFB = *(plugin->ControlSourceFB); plugin->LastDestLR = *(plugin->ControlDestLR); plugin->LastDestFB = *(plugin->ControlDestFB); plugin->LastDiffusion = *(plugin->ControlDiffusion); if(fadeIn==0) { //rather than updating the er straight away, fade out the existing ones. fadeOut=1; } else { //we've just done a fade out so we can update the ers (seens we have to do it again!) and fade in these ones instead. calculateIReverbERWrapper(instance); } } /* check if any other params have changed */ checkParamChange(IERR_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); fWarmthDelta = getParamChange(IERR_WARMTH, plugin->ControlWarmth, &(plugin->LastWarmth), &(plugin->ConvertedWarmth), plugin->SampleRate, pParamFunc); fHPFDelta = getParamChange(IERR_HPF, plugin->ControlHPF, &(plugin->LastHPF), &(plugin->ConvertedHPF), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; if(fWarmthDelta == 0 && fHPFDelta==0) { HasDelta=0; WarmthSamples = plugin->ConvertedWarmth; HPFsamples = plugin->ConvertedHPF; } else { HasDelta=1; WarmthSamples = plugin->ConvertedWarmth - fWarmthDelta; HPFsamples = plugin->ConvertedHPF - fHPFDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fWarmthDelta = fWarmthDelta/(float)SampleCount; fHPFDelta = fHPFDelta/(float)SampleCount; } } er_size = plugin->er_size; SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; AudioHPF = plugin->AudioHPFLast; AudioIn1 = plugin->AudioIn1Last; AudioIn2 = plugin->AudioIn2Last; AudioIn3 = plugin->AudioIn3Last; AudioIn4 = plugin->AudioIn4Last; pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; EnvIn = plugin->EnvInLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; fadeVol = 1.0; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { In=*(pfAudioInputL++); // apply HPF as bottom end in reverbs sounds crap AudioHPF = ((HPFsamples-1) * AudioHPF + In) / HPFsamples; AudioIn = In - AudioHPF; // apply simple LPF filter repeatedly to audio to simluate frequency loss with each reflection AudioIn1=((WarmthSamples-1) * AudioIn1 + AudioIn) / WarmthSamples; AudioIn2=((WarmthSamples-1) * AudioIn2 + AudioIn1) / WarmthSamples; AudioIn3=((WarmthSamples-1) * AudioIn3 + AudioIn2) / WarmthSamples; AudioIn4=((WarmthSamples-1) * AudioIn4 + AudioIn3) / WarmthSamples; er = plugin->er; // calculate any fading if(fadeIn==1) { fadeVol=(float)lSampleIndex/(float)SampleCount; } if(fadeOut==1) { fadeVol=1.0-((float)lSampleIndex/(float)SampleCount); } // now calculate the reflections for(i=0;iReflections) { case 0: AudioProc=AudioIn; break; case 1: AudioProc=AudioIn1; break; case 2: AudioProc=AudioIn2; break; case 3: AudioProc=AudioIn3; break; case 4: default: AudioProc=AudioIn4; break; } // do any fading if(fadeIn==1 || fadeOut==1) { AudioProc=AudioProc*fadeVol; } // add to the delay space SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, er->Delay, er->DelayOffset, AudioProc*er->GainL); SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, er->Delay, er->DelayOffset, AudioProc*er->GainR); er++; } // read the audio out of the delay space OutL = *(SpaceLCur); OutR = *(SpaceRCur); *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); //update any changeing parameters if(HasDelta==1) { WarmthSamples += fWarmthDelta; HPFsamples += fHPFDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = 0; *(pfAudioOutputR++) = 0; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero filters AudioHPF=0; AudioIn1=0; AudioIn2=0; AudioIn3=0; AudioIn4=0; //zero evelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; } if(fadeIn==1) { //we've fadded in the new er, so turn off the flag plugin->fadeIn=0; } if(fadeOut==1) { //we've fadded out the exisiting er, update the ers for the next run and flag it to be fadded in plugin->fadeIn=1; calculateIReverbERWrapper(instance); } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->AudioHPFLast=(fabs(AudioHPF)<1.0e-10) ? 0.f : AudioHPF; plugin->AudioIn1Last=(fabs(AudioIn1)<1.0e-10) ? 0.f : AudioIn1; plugin->AudioIn2Last=(fabs(AudioIn2)<1.0e-10) ? 0.f : AudioIn2; plugin->AudioIn3Last=(fabs(AudioIn3)<1.0e-10) ? 0.f : AudioIn3; plugin->AudioIn4Last=(fabs(AudioIn4)<1.0e-10) ? 0.f : AudioIn4; plugin->EnvInLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; // update the meters *(plugin->MeterInput) =(EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void runSumIReverbER(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float *pfAudioInputL; float *pfAudioInputR; float *pfAudioOutputL; float *pfAudioOutputR; float In,EnvIn; float OutL,EnvOutL; float OutR,EnvOutR; float AudioIn,AudioHPF,AudioIn1,AudioIn2,AudioIn3,AudioIn4,AudioProc; float fBypass,HPFsamples,WarmthSamples; int fadeOut,fadeIn; float fadeVol; double fWarmthDelta,fHPFDelta; int HasDelta; struct ERunit * er; unsigned long lSampleIndex; unsigned int i; unsigned int er_size; unsigned long SpaceSize; float *SpaceLStr; float *SpaceRStr; float *SpaceLCur; float *SpaceRCur; float *SpaceLEnd; float *SpaceREnd; IReverbER *plugin = (IReverbER *)instance; pParamFunc = &convertParam; fadeIn=plugin->fadeIn; fadeOut=0; /* see if the room has changed and recalculate the reflection details if needed */ if(*(plugin->ControlRoomLength) != plugin->LastRoomLength || *(plugin->ControlRoomWidth) != plugin->LastRoomWidth || *(plugin->ControlRoomHeight) != plugin->LastRoomHeight || *(plugin->ControlSourceLR) != plugin->LastSourceLR || *(plugin->ControlSourceFB) != plugin->LastSourceFB || *(plugin->ControlDestLR) != plugin->LastDestLR || *(plugin->ControlDestFB) != plugin->LastDestFB || *(plugin->ControlDiffusion) != plugin->LastDiffusion ) { plugin->LastRoomLength = *(plugin->ControlRoomLength); plugin->LastRoomWidth = *(plugin->ControlRoomWidth); plugin->LastRoomHeight = *(plugin->ControlRoomHeight); plugin->LastSourceLR = *(plugin->ControlSourceLR); plugin->LastSourceFB = *(plugin->ControlSourceFB); plugin->LastDestLR = *(plugin->ControlDestLR); plugin->LastDestFB = *(plugin->ControlDestFB); plugin->LastDiffusion = *(plugin->ControlDiffusion); if(fadeIn==0) { //rather than updating the er straight away, fade out the existing ones. fadeOut=1; } else { //we've just done a fade out so we can update the ers (again!) and fade in these ones instead. calculateIReverbERWrapper(instance); } } /* check if any other params have changed */ checkParamChange(IERR_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); fWarmthDelta = getParamChange(IERR_WARMTH, plugin->ControlWarmth, &(plugin->LastWarmth), &(plugin->ConvertedWarmth), plugin->SampleRate, pParamFunc); fHPFDelta = getParamChange(IERR_HPF, plugin->ControlHPF, &(plugin->LastHPF), &(plugin->ConvertedHPF), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; if(fWarmthDelta == 0 && fHPFDelta==0) { HasDelta=0; WarmthSamples = plugin->ConvertedWarmth; HPFsamples = plugin->ConvertedHPF; } else { HasDelta=1; WarmthSamples = plugin->ConvertedWarmth - fWarmthDelta; HPFsamples = plugin->ConvertedHPF - fHPFDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fWarmthDelta = fWarmthDelta/(float)SampleCount; fHPFDelta = fHPFDelta/(float)SampleCount; } } er_size = plugin->er_size; SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; AudioHPF = plugin->AudioHPFLast; AudioIn1 = plugin->AudioIn1Last; AudioIn2 = plugin->AudioIn2Last; AudioIn3 = plugin->AudioIn3Last; AudioIn4 = plugin->AudioIn4Last; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; EnvIn = plugin->EnvInLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; fadeVol = 1.0; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { In=( *(pfAudioInputL++) + *(pfAudioInputR++) )/2; // apply HPF as bottom end in reverbs sounds crap AudioHPF = ((HPFsamples-1) * AudioHPF + In) / HPFsamples; AudioIn = In - AudioHPF; // apply simple filter repeatedly to audio to simluate frequency loss with each reflection AudioIn1=((WarmthSamples-1) * AudioIn1 + AudioIn) / WarmthSamples; AudioIn2=((WarmthSamples-1) * AudioIn2 + AudioIn1) / WarmthSamples; AudioIn3=((WarmthSamples-1) * AudioIn3 + AudioIn2) / WarmthSamples; AudioIn4=((WarmthSamples-1) * AudioIn4 + AudioIn3) / WarmthSamples; er = plugin->er; // calculate any fading if(fadeIn==1) { fadeVol=(float)lSampleIndex/(float)SampleCount; } if(fadeOut==1) { fadeVol=1.0-((float)lSampleIndex/(float)SampleCount); } // now calculate the reflections for(i=0;iReflections) { case 0: AudioProc=AudioIn; break; case 1: AudioProc=AudioIn1; break; case 2: AudioProc=AudioIn2; break; case 3: AudioProc=AudioIn3; break; case 4: default: AudioProc=AudioIn4; break; } // do any fading if(fadeIn==1 || fadeOut==1) { AudioProc=AudioProc*fadeVol; } // add to the delay space SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, er->Delay, er->DelayOffset, AudioProc*er->GainL); SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, er->Delay, er->DelayOffset, AudioProc*er->GainR); er++; } // read the audio out of the delay space OutL = *(SpaceLCur); OutR = *(SpaceRCur); *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); //update any changing parameters if(HasDelta==1) { WarmthSamples += fWarmthDelta; HPFsamples += fHPFDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = 0; *(pfAudioOutputR++) = 0; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero filters AudioHPF=0; AudioIn1=0; AudioIn2=0; AudioIn3=0; AudioIn4=0; //zero evelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; } if(fadeIn==1) { //we've fadded in the new er, so turn off the flag plugin->fadeIn=0; } if(fadeOut==1) { //we've fadded out the exisiting er, update the ers for the next run and flag it to be fadded in plugin->fadeIn=1; calculateIReverbERWrapper(instance); } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->AudioHPFLast=(fabs(AudioHPF)<1.0e-10) ? 0.f : AudioHPF; plugin->AudioIn1Last=(fabs(AudioIn1)<1.0e-10) ? 0.f : AudioIn1; plugin->AudioIn2Last=(fabs(AudioIn2)<1.0e-10) ? 0.f : AudioIn2; plugin->AudioIn3Last=(fabs(AudioIn3)<1.0e-10) ? 0.f : AudioIn3; plugin->AudioIn4Last=(fabs(AudioIn4)<1.0e-10) ? 0.f : AudioIn4; plugin->EnvInLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; // update the meters *(plugin->MeterInput) =(EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void cleanupIReverbER(LV2_Handle instance) { IReverbER *plugin = (IReverbER *)instance; free(plugin->er); free(plugin->SpaceL); free(plugin->SpaceR); free(instance); } static void init() { IReverbERMonoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IReverbERMonoDescriptor->URI = IERR_MONO_URI; IReverbERMonoDescriptor->activate = activateIReverbER; IReverbERMonoDescriptor->cleanup = cleanupIReverbER; IReverbERMonoDescriptor->connect_port = connectPortIReverbER; IReverbERMonoDescriptor->deactivate = NULL; IReverbERMonoDescriptor->instantiate = instantiateIReverbER; IReverbERMonoDescriptor->run = runMonoIReverbER; IReverbERMonoDescriptor->extension_data = NULL; IReverbERSumDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IReverbERSumDescriptor->URI = IERR_SUM_URI; IReverbERSumDescriptor->activate = activateIReverbER; IReverbERSumDescriptor->cleanup = cleanupIReverbER; IReverbERSumDescriptor->connect_port = connectPortIReverbER; IReverbERSumDescriptor->deactivate = NULL; IReverbERSumDescriptor->instantiate = instantiateIReverbER; IReverbERSumDescriptor->run = runSumIReverbER; IReverbERSumDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IReverbERMonoDescriptor) init(); switch (index) { case 0: return IReverbERMonoDescriptor; case 1: return IReverbERSumDescriptor; default: return NULL; } } /*****************************************************************************/ void calculateIReverbERWrapper(LV2_Handle instance) { IReverbER *plugin = (IReverbER *)instance; float convertedWidth,convertedLength,convertedHeight,convertedSourceLR,convertedSourceFB,convertedDestLR,convertedDestFB,convertedDiffusion; if (plugin->LastRoomWidth < 3.0) convertedWidth = 3.0; else if (plugin->LastRoomWidth <= 100.0) convertedWidth = plugin->LastRoomWidth; else convertedWidth = 100.0; if (plugin->LastRoomLength < 3.0) convertedLength = 3.0; else if (plugin->LastRoomLength <= 100.0) convertedLength = plugin->LastRoomLength; else convertedLength = 100.0; if (plugin->LastRoomHeight < 3.0) convertedHeight = 3.0; else if (plugin->LastRoomHeight <= 30.0) convertedHeight = plugin->LastRoomHeight; else convertedHeight = 30.0; if (plugin->LastSourceLR < -0.99) convertedSourceLR = -0.99; else if (plugin->LastSourceLR <= 0.99) convertedSourceLR = plugin->LastSourceLR; else convertedSourceLR = 0.99; if (plugin->LastSourceFB < 0.51) convertedSourceFB = 0.51; else if (plugin->LastSourceFB <= 0.99) convertedSourceFB = plugin->LastSourceFB; else convertedSourceFB = 0.99; if (plugin->LastDestLR < -0.99) convertedDestLR = -0.99; else if (plugin->LastDestLR <= 0.99) convertedDestLR = plugin->LastDestLR; else convertedDestLR = 0.99; if (plugin->LastDestFB < 0.01) convertedDestFB = 0.01; else if (plugin->LastDestFB <= 0.49) convertedDestFB = plugin->LastDestFB; else convertedDestFB = 0.49; if (plugin->LastDiffusion < 0.0) convertedDiffusion = 0.0; else if (plugin->LastDiffusion <= 100.0) convertedDiffusion = plugin->LastDiffusion/100; else convertedDiffusion = 1.0; plugin->er_size=calculateIReverbER(plugin->er, MAX_ER, convertedWidth, convertedLength, convertedHeight, convertedSourceLR, convertedSourceFB, convertedDestLR, convertedDestFB, OBJECT_HEIGHT, convertedDiffusion, plugin->SampleRate); } float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IERR_BYPASS: if(value<=0.0) result= 0; else result= 1; break; case IERR_HPF: if (value < 20) result = sr/(40.0); else if (value <= 2000.0) result = sr/(2*value); else result=sr/(4000.0); break; case IERR_WARMTH: if(value<0) result= 1; else if (value < 100) result = pow(2,value/50); else result= 4; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_testtone.h0000664000175000017500000000212611251515772022522 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ITONE_URI "http://invadarecords.com/plugins/lv2/testtone"; #define ITONE_GUI_URI "http://invadarecords.com/plugins/lv2/testtone/gui"; #define ITONE_ACTIVE 0 #define ITONE_FREQ 1 #define ITONE_TRIM 2 #define ITONE_AUDIO_OUT 3 #define ITONE_METER_OUT 4 /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_input.c0000664000175000017500000003034411251515772022012 0ustar alessioalessio/* This LV2 plugin provides a stereo input module (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "library/common.h" #include "inv_input.h" static LV2_Descriptor *IInputDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *ControlPhaseL; float *ControlPhaseR; float *ControlGain; float *ControlPan; float *ControlWidth; float *ControlNoClip; float *AudioInputBufferL; float *AudioInputBufferR; float *AudioOutputBufferL; float *AudioOutputBufferR; float *MeterInputL; float *MeterInputR; float *MeterOutputL; float *MeterOutputR; float *MeterPhase; float *MeterDrive; /* stuff we need to remember to reduce cpu */ double SampleRate; struct Envelope EnvAD[4]; /* stuff we need to remember to reduce cpu */ float LastBypass; float LastPhaseL; float LastPhaseR; float LastGain; float LastPan; float LastWidth; float LastNoClip; float ConvertedBypass; float ConvertedPhaseL; float ConvertedPhaseR; float ConvertedGain; float ConvertedPan; float ConvertedWidth; float ConvertedNoClip; float EnvInLLast; float EnvInRLast; float EnvOutLLast; float EnvOutRLast; float EnvPhaseLast; float EnvDriveLast; } IInput; static LV2_Handle instantiateIInput(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IInput *plugin = (IInput *)malloc(sizeof(IInput)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; return (LV2_Handle)plugin; } static void connectPortIInput(LV2_Handle instance, uint32_t port, void *data) { IInput *plugin = (IInput *)instance; switch (port) { case IINPUT_BYPASS: plugin->ControlBypass = data; break; case IINPUT_PHASEL: plugin->ControlPhaseL = data; break; case IINPUT_PHASER: plugin->ControlPhaseR = data; break; case IINPUT_GAIN: plugin->ControlGain = data; break; case IINPUT_PAN: plugin->ControlPan = data; break; case IINPUT_WIDTH: plugin->ControlWidth = data; break; case IINPUT_NOCLIP: plugin->ControlNoClip = data; break; case IINPUT_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IINPUT_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IINPUT_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IINPUT_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IINPUT_METER_INL: plugin->MeterInputL = data; break; case IINPUT_METER_INR: plugin->MeterInputR = data; break; case IINPUT_METER_OUTL: plugin->MeterOutputL = data; break; case IINPUT_METER_OUTR: plugin->MeterOutputR = data; break; case IINPUT_METER_PHASE: plugin->MeterPhase = data; break; case IINPUT_METER_DRIVE: plugin->MeterDrive = data; break; } } static void activateIInput(LV2_Handle instance) { IInput *plugin = (IInput *)instance; // these values force the conversion to take place plugin->LastBypass = 0; plugin->LastPhaseL = 0; plugin->LastPhaseR = 0; plugin->LastGain = 0; plugin->LastPan = 0; plugin->LastWidth = 0; plugin->LastNoClip = 0; plugin->EnvInLLast = 0; plugin->EnvInRLast = 0; plugin->EnvOutLLast = 0; plugin->EnvOutRLast = 0; plugin->EnvPhaseLast = 0; plugin->EnvDriveLast = 0; plugin->ConvertedBypass = convertParam(IINPUT_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedPhaseL = convertParam(IINPUT_PHASEL, plugin->LastPhaseL, plugin->SampleRate); plugin->ConvertedPhaseR = convertParam(IINPUT_PHASER, plugin->LastPhaseR, plugin->SampleRate); plugin->ConvertedGain = convertParam(IINPUT_GAIN, plugin->LastGain, plugin->SampleRate); plugin->ConvertedPan = convertParam(IINPUT_PAN, plugin->LastPan, plugin->SampleRate); plugin->ConvertedWidth = convertParam(IINPUT_WIDTH, plugin->LastWidth, plugin->SampleRate); plugin->ConvertedNoClip = convertParam(IINPUT_NOCLIP, plugin->LastNoClip, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runIInput(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float fBypass,fPhaseL,fPhaseR,fGain,fPan,fLPan,fRPan,fWidth,fMono,fStereoL,fStereoR,fNoClip; double fGainDelta,fPanDelta,fWidthDelta; int HasDelta; float fAudioL,fAudioR; float drive; float driveL=0; float driveR=0; float InL,EnvInL,EnvOutL; float InR,EnvInR,EnvOutR; float CurrentPhase,EnvPhase,EnvDrive; uint32_t lSampleIndex; IInput *plugin = (IInput *)instance; pParamFunc = &convertParam; checkParamChange(IINPUT_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IINPUT_PHASEL, plugin->ControlPhaseL, &(plugin->LastPhaseL), &(plugin->ConvertedPhaseL), plugin->SampleRate, pParamFunc); checkParamChange(IINPUT_PHASER, plugin->ControlPhaseR, &(plugin->LastPhaseR), &(plugin->ConvertedPhaseR), plugin->SampleRate, pParamFunc); checkParamChange(IINPUT_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(IINPUT_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fPanDelta = getParamChange(IINPUT_PAN, plugin->ControlPan, &(plugin->LastPan), &(plugin->ConvertedPan), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IINPUT_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fPhaseL = plugin->ConvertedPhaseL; fPhaseR = plugin->ConvertedPhaseR; fNoClip = plugin->ConvertedNoClip; if(fGainDelta == 0 && fPanDelta==0 && fWidthDelta==0) { HasDelta=0; fGain = plugin->ConvertedGain; fPan = plugin->ConvertedPan; fWidth = plugin->ConvertedWidth; } else { HasDelta=1; fGain = plugin->ConvertedGain - fGainDelta; fPan = plugin->ConvertedPan - fPanDelta; fWidth = plugin->ConvertedWidth - fWidthDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fGainDelta = fGainDelta/(float)SampleCount; fPanDelta = fPanDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; } } fLPan=1-fPan; fRPan=1+fPan; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvPhase = plugin->EnvPhaseLast; EnvDrive = plugin->EnvDriveLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); InR=*(pfAudioInputR++); fAudioL = fPhaseL > 0 ? -InL : InL ; fAudioR = fPhaseR > 0 ? -InR : InR ; fAudioL *= fGain; fAudioR *= fGain; fAudioL *= fLPan; fAudioR *= fRPan; if(fWidth<=0) { fMono = (fAudioL + fAudioR) / 2; fAudioL = (1+fWidth)*fAudioL - fWidth*fMono; fAudioR = (1+fWidth)*fAudioR - fWidth*fMono; } else { fStereoL = (fAudioL - fAudioR) / 2; fStereoR = (fAudioR - fAudioL) / 2; fAudioL = (1-fWidth)*fAudioL + fWidth*fStereoL; fAudioR = (1-fWidth)*fAudioR + fWidth*fStereoR; } fAudioL = fNoClip > 0 ? InoClip(fAudioL,&driveL) : fAudioL; fAudioR = fNoClip > 0 ? InoClip(fAudioR,&driveR) : fAudioR; *(pfAudioOutputL++) = fAudioL; *(pfAudioOutputR++) = fAudioR; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioR, EnvOutR); if(fabs(fAudioL) > 0.001 || fabs(fAudioR) > 0.001) { // -60 db CurrentPhase = fabs(fAudioL+fAudioR) > 0.000001 ? atan(fabs((fAudioL-fAudioR)/(fAudioL+fAudioR))) : PI_ON_2; } else { CurrentPhase =0; } EnvPhase += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE],CurrentPhase,EnvPhase); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fGain += fGainDelta; fPan += fPanDelta; fWidth += fWidthDelta; fLPan=1-fPan; fRPan=1+fPan; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //evelope on in and out for meters EnvInL =0; EnvInR =0; EnvOutL =0; EnvOutR =0; EnvPhase =0; EnvDrive =0; } // store values for next loop plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvPhaseLast = (fabs(EnvPhase)<1.0e-10) ? 0.f : EnvPhase; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; *(plugin->MeterPhase)=EnvPhase; *(plugin->MeterDrive)=EnvDrive; } static void cleanupIInput(LV2_Handle instance) { free(instance); } static void init() { IInputDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IInputDescriptor->URI = IINPUT_URI; IInputDescriptor->activate = activateIInput; IInputDescriptor->cleanup = cleanupIInput; IInputDescriptor->connect_port = connectPortIInput; IInputDescriptor->deactivate = NULL; IInputDescriptor->instantiate = instantiateIInput; IInputDescriptor->run = runIInput; IInputDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IInputDescriptor) init(); switch (index) { case 0: return IInputDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IINPUT_BYPASS: case IINPUT_PHASEL: case IINPUT_PHASER: if(value<=0.0) result= 0; else result= 1; break; case IINPUT_GAIN: if(value<-24) result= pow(10, -24/20); else if (value < 24) result= pow(10, value/20); else result= pow(10, 1.2); break; case IINPUT_PAN: case IINPUT_WIDTH: if(value < -1) result= -1; else if (value < 1) result= value; else result= 1; break; case IINPUT_NOCLIP: if(value<=0.0) result= 0; else result= 1; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_erreverb.h0000664000175000017500000000337311251515772022476 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IERR_GUI_URI "http://invadarecords.com/plugins/lv2/erreverb/gui" #define IERR_MONO_URI "http://invadarecords.com/plugins/lv2/erreverb/mono" #define IERR_SUM_URI "http://invadarecords.com/plugins/lv2/erreverb/sum" #define IERR_BYPASS 0 #define IERR_ROOMLENGTH 1 #define IERR_ROOMWIDTH 2 #define IERR_ROOMHEIGHT 3 #define IERR_SOURCELR 4 #define IERR_SOURCEFB 5 #define IERR_DESTLR 6 #define IERR_DESTFB 7 #define IERR_HPF 8 #define IERR_WARMTH 9 #define IERR_DIFFUSION 10 #define IERR_AUDIO_OUTL 11 #define IERR_AUDIO_OUTR 12 #define IERR_AUDIO_INL 13 #define IERR_METER_IN 14 #define IERR_METER_OUTL 15 #define IERR_METER_OUTR 16 #define IERR_AUDIO_INR 17 /* not used in mono in mode */ #define REVERB_SPACE_SIZE 2 /* size in seconds */ #define OBJECT_HEIGHT 1.5 /* the height of the sound source and the listener */ /* works out the reflection details */ void calculateIReverbERWrapper(LV2_Handle instance); /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_delay.c0000664000175000017500000012063611251515772021755 0ustar alessioalessio/* This LV2 plugin provides munged delay plugins (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "library/common.h" #include "inv_delay.h" static LV2_Descriptor *IDelayMonoDescriptor = NULL; static LV2_Descriptor *IDelaySumDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *ControlMode; float *ControlMungeMode; float *ControlMunge; float *ControlCycle; float *ControlWidth; float *Control1Delay; float *Control1FB; float *Control1Pan; float *Control1Vol; float *Control2Delay; float *Control2FB; float *Control2Pan; float *Control2Vol; float *AudioOutputBufferL; float *AudioOutputBufferR; float *AudioInputBufferL; float *AudioInputBufferR; float *LampLFO; float *MeterInputL; float *MeterOutputL; float *MeterOutputR; double SampleRate; struct Envelope EnvAD[4]; /* Stuff to remember to avoid recalculating the delays every run */ float LastBypass; float LastMode; float LastMungeMode; float LastMunge; float LastCycle; float LastWidth; float Last1Delay; float Last1FB; float Last1Pan; float Last1Vol; float Last2Delay; float Last2FB; float Last2Pan; float Last2Vol; float LFOAngle; float AudioLPF1; float AudioLPF2; float AudioHPF1; float AudioHPF2; float AudioDegrain1; float AudioDegrain2; float EnvInLLast; float EnvOutLLast; float EnvOutRLast; float ConvertedBypass; float ConvertedMode; float ConvertedMungeMode; float ConvertedMunge; float ConvertedCycle; float ConvertedWidth; float ConvertedLPFsamples; float ConvertedHPFsamples; float Converted1Delay; float Converted1FB; float Converted1Pan; float Converted1Vol; float Converted2Delay; float Converted2FB; float Converted2Pan; float Converted2Vol; /* Delay Space Data */ unsigned long SpaceSize; float * SpaceL; float * SpaceR; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; } IDelay; static LV2_Handle instantiateIDelay(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IDelay *plugin = (IDelay *)malloc(sizeof(IDelay)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; plugin->SpaceSize = IDELAY_SPACE_SIZE * s_rate / 1000; /* the delay space */ if((plugin->SpaceL = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; if((plugin->SpaceR = (float *)malloc(sizeof(float) * plugin->SpaceSize))==NULL) return NULL; return (LV2_Handle)plugin; } static void connectPortIDelay(LV2_Handle instance, uint32_t port, void *data) { IDelay *plugin = (IDelay *)instance; switch (port) { case IDELAY_BYPASS: plugin->ControlBypass = data; break; case IDELAY_MODE: plugin->ControlMode = data; break; case IDELAY_MUNGEMODE: plugin->ControlMungeMode = data; break; case IDELAY_MUNGE: plugin->ControlMunge = data; break; case IDELAY_LFO_CYCLE: plugin->ControlCycle = data; break; case IDELAY_LFO_WIDTH: plugin->ControlWidth = data; break; case IDELAY_1_DELAY: plugin->Control1Delay = data; break; case IDELAY_1_FB: plugin->Control1FB = data; break; case IDELAY_1_PAN: plugin->Control1Pan = data; break; case IDELAY_1_VOL: plugin->Control1Vol = data; break; case IDELAY_2_DELAY: plugin->Control2Delay = data; break; case IDELAY_2_FB: plugin->Control2FB = data; break; case IDELAY_2_PAN: plugin->Control2Pan = data; break; case IDELAY_2_VOL: plugin->Control2Vol = data; break; case IDELAY_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IDELAY_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IDELAY_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IDELAY_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IDELAY_METER_INL: plugin->MeterInputL = data; break; case IDELAY_METER_OUTL: plugin->MeterOutputL = data; break; case IDELAY_METER_OUTR: plugin->MeterOutputR = data; break; case IDELAY_LAMP_LFO: plugin->LampLFO = data; break; } } static void activateIDelay(LV2_Handle instance) { IDelay *plugin = (IDelay *)instance; unsigned long i; float * p; float * q; //set ourselves at the beginning of space plugin->SpaceLCur=plugin->SpaceL; plugin->SpaceRCur=plugin->SpaceR; // clear space p=plugin->SpaceL; q=plugin->SpaceR; for(i=0; i < plugin->SpaceSize; i++) { *(p++)=0; *(q++)=0; } plugin->SpaceLEnd=--p; plugin->SpaceREnd=--q; //set defaults plugin->LastBypass = 0.0; plugin->LastMode = 0.0; plugin->LastMungeMode = 0.0; plugin->LastMunge = 50.0; plugin->LastCycle = 20.0; plugin->LastWidth = 0.0; plugin->Last1Delay = 0.3; plugin->Last1FB = 50.0; plugin->Last1Pan = -0.7; plugin->Last1Vol = 100.0; plugin->Last2Delay = 0.2; plugin->Last2FB = 50.0; plugin->Last2Pan = 0.7; plugin->Last2Vol = 100.0; plugin->LFOAngle = 0; plugin->AudioLPF1 = 0; plugin->AudioLPF2 = 0; plugin->AudioHPF1 = 0; plugin->AudioHPF2 = 0; plugin->AudioDegrain1 = 0; plugin->AudioDegrain2 = 0; plugin->EnvInLLast = 0; plugin->EnvOutLLast = 0; plugin->EnvOutRLast = 0; plugin->ConvertedBypass = convertParam(IDELAY_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedMode = convertParam(IDELAY_MODE, plugin->LastMode, plugin->SampleRate); plugin->ConvertedMungeMode = convertParam(IDELAY_MUNGEMODE, plugin->LastMungeMode, plugin->SampleRate); plugin->ConvertedMunge = convertParam(IDELAY_MUNGE, plugin->LastMunge, plugin->SampleRate); plugin->ConvertedLPFsamples = convertMunge(0, plugin->LastMunge, plugin->SampleRate); plugin->ConvertedHPFsamples = convertMunge(1, plugin->LastMunge, plugin->SampleRate); plugin->ConvertedCycle = convertParam(IDELAY_LFO_CYCLE, plugin->LastCycle, plugin->SampleRate); plugin->ConvertedWidth = convertParam(IDELAY_LFO_WIDTH, plugin->LastWidth, plugin->SampleRate); plugin->Converted1Delay = convertParam(IDELAY_1_DELAY, plugin->Last1Delay, plugin->SampleRate); plugin->Converted1FB = convertParam(IDELAY_1_FB, plugin->Last1FB, plugin->SampleRate); plugin->Converted1Pan = convertParam(IDELAY_1_PAN, plugin->Last1Pan, plugin->SampleRate); plugin->Converted1Vol = convertParam(IDELAY_1_VOL, plugin->Last1Vol, plugin->SampleRate); plugin->Converted2Delay = convertParam(IDELAY_2_DELAY, plugin->Last2Delay, plugin->SampleRate); plugin->Converted2FB = convertParam(IDELAY_2_FB, plugin->Last2FB, plugin->SampleRate); plugin->Converted2Pan = convertParam(IDELAY_2_PAN, plugin->Last2Pan, plugin->SampleRate); plugin->Converted2Vol = convertParam(IDELAY_2_VOL, plugin->Last2Vol, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoIDelay(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float * pfAudioOutputR; float In,Out1,Out2,OutL,OutR; float LPF1,LPF2,HPF1,HPF2,Degrain1,Degrain2; float EnvIn,EnvOutL,EnvOutR; float fBypass,fMode,fMunge,fMungeMode,fHPFsamples,fLPFsamples,fAngle,fAngleDelta,fLFO; float f1Delay,f1DelayOffset,fLFOsamp1,fActualDelay1; float f2Delay,f2DelayOffset,fLFOsamp2,fActualDelay2; float f1DelayDelta,f1DelayOld,f1DelayOffsetOld,fLFOsamp1Old,fActualDelay1Old; float f2DelayDelta,f2DelayOld,f2DelayOffsetOld,fLFOsamp2Old,fActualDelay2Old; float oldVol,newVol; float f1Vol,f1Pan,f1PanLGain,f1PanRGain,f1FBraw,f1FB,In1FB,In1FBmix,In1Munged; float f2Vol,f2Pan,f2PanLGain,f2PanRGain,f2FBraw,f2FB,In2FB,In2FBmix,In2Munged; double fMungeDelta,fLPFDelta,fHPFDelta,fCycleDelta,fWidthDelta,fFB1Delta,fPan1Delta,fVol1Delta,fFB2Delta,fPan2Delta,fVol2Delta; int HasDelta,HasDelay1Old,HasDelay2Old; unsigned long l1DelaySample, l2DelaySample; unsigned long l1DelaySampleOld, l2DelaySampleOld; unsigned long lSampleIndex; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IDelay *plugin = (IDelay *)instance; pParamFunc = &convertParam; /* check if any other params have changed */ checkParamChange(IDELAY_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IDELAY_MODE, plugin->ControlMode, &(plugin->LastMode), &(plugin->ConvertedMode), plugin->SampleRate, pParamFunc); checkParamChange(IDELAY_MUNGEMODE, plugin->ControlMungeMode, &(plugin->LastMungeMode), &(plugin->ConvertedMungeMode), plugin->SampleRate, pParamFunc); fMungeDelta = getParamChange(IDELAY_MUNGE, plugin->ControlMunge, &(plugin->LastMunge), &(plugin->ConvertedMunge), plugin->SampleRate, pParamFunc); fCycleDelta = getParamChange(IDELAY_LFO_CYCLE, plugin->ControlCycle, &(plugin->LastCycle), &(plugin->ConvertedCycle), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IDELAY_LFO_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); f1DelayDelta = getParamChange(IDELAY_1_DELAY, plugin->Control1Delay, &(plugin->Last1Delay), &(plugin->Converted1Delay), plugin->SampleRate, pParamFunc); fFB1Delta = getParamChange(IDELAY_1_FB, plugin->Control1FB, &(plugin->Last1FB), &(plugin->Converted1FB), plugin->SampleRate, pParamFunc); fPan1Delta = getParamChange(IDELAY_1_PAN, plugin->Control1Pan, &(plugin->Last1Pan), &(plugin->Converted1Pan), plugin->SampleRate, pParamFunc); fVol1Delta = getParamChange(IDELAY_1_VOL, plugin->Control1Vol, &(plugin->Last1Vol), &(plugin->Converted1Vol), plugin->SampleRate, pParamFunc); f2DelayDelta = getParamChange(IDELAY_2_DELAY, plugin->Control2Delay, &(plugin->Last2Delay), &(plugin->Converted2Delay), plugin->SampleRate, pParamFunc); fFB2Delta = getParamChange(IDELAY_2_FB, plugin->Control2FB, &(plugin->Last2FB), &(plugin->Converted2FB), plugin->SampleRate, pParamFunc); fPan2Delta = getParamChange(IDELAY_2_PAN, plugin->Control2Pan, &(plugin->Last2Pan), &(plugin->Converted2Pan), plugin->SampleRate, pParamFunc); fVol2Delta = getParamChange(IDELAY_2_VOL, plugin->Control2Vol, &(plugin->Last2Vol), &(plugin->Converted2Vol), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fMode = plugin->ConvertedMode; fMungeMode = plugin->ConvertedMungeMode; if(fMungeDelta==0 && fCycleDelta == 0 && fWidthDelta==0 && fFB1Delta==0 && fFB2Delta==0 && fPan1Delta==0 && fPan2Delta==0 && fVol1Delta==0 && fVol2Delta==0) { HasDelta=0; fMunge = plugin->ConvertedMunge; fLPFDelta = 0.0; fHPFDelta = 0.0; fLPFsamples = plugin->ConvertedLPFsamples; fHPFsamples = plugin->ConvertedHPFsamples; fAngleDelta = plugin->ConvertedCycle; fLFO = plugin->ConvertedWidth; f1FBraw = plugin->Converted1FB; f1Pan = plugin->Converted1Pan; f1Vol = plugin->Converted1Vol; f2FBraw = plugin->Converted2FB; f2Pan = plugin->Converted2Pan; f2Vol = plugin->Converted2Vol; } else { HasDelta = 1; fMunge = plugin->ConvertedMunge - fMungeDelta; if(fMungeDelta == 0) { fLPFDelta = 0.0; fHPFDelta = 0.0; } else { // this is a bit wonky i know but creating varibles for the old values and then calculating the delta with new-old doesn't save any cpu fLPFDelta = -plugin->ConvertedLPFsamples; fHPFDelta = -plugin->ConvertedHPFsamples; plugin->ConvertedLPFsamples = convertMunge(0, plugin->LastMunge, plugin->SampleRate); plugin->ConvertedHPFsamples = convertMunge(1, plugin->LastMunge, plugin->SampleRate); fLPFDelta += plugin->ConvertedLPFsamples; fHPFDelta += plugin->ConvertedHPFsamples; } fLPFsamples = plugin->ConvertedLPFsamples - fLPFDelta; fHPFsamples = plugin->ConvertedHPFsamples - fHPFDelta; fAngleDelta = plugin->ConvertedCycle - fCycleDelta; fLFO = plugin->ConvertedWidth - fWidthDelta; f1FBraw = plugin->Converted1FB - fFB1Delta; f1Pan = plugin->Converted1Pan - fPan1Delta; f1Vol = plugin->Converted1Vol - fVol1Delta; f2FBraw = plugin->Converted2FB - fFB2Delta; f2Pan = plugin->Converted2Pan - fPan2Delta; f2Vol = plugin->Converted2Vol - fVol2Delta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fLPFDelta = fLPFDelta/(float)SampleCount; fHPFDelta = fHPFDelta/(float)SampleCount; fMungeDelta = fMungeDelta/(float)SampleCount; fCycleDelta = fCycleDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; fFB1Delta = fFB1Delta/(float)SampleCount; fPan1Delta = fPan1Delta/(float)SampleCount; fVol1Delta = fVol1Delta/(float)SampleCount; fFB2Delta = fFB2Delta/(float)SampleCount; fPan2Delta = fPan2Delta/(float)SampleCount; fVol2Delta = fVol2Delta/(float)SampleCount; } } if(f1DelayDelta==0.0) { HasDelay1Old = 0; f1Delay = plugin->Converted1Delay; l1DelaySample = (unsigned long)f1Delay; f1DelayOffset = f1Delay-(float)l1DelaySample; fLFOsamp1 = fLFO * f1Delay; f1DelayOld = 0.0; l1DelaySampleOld= 0; f1DelayOffsetOld= 0.0; fLFOsamp1Old = 0.0; } else { HasDelay1Old = 1; f1Delay = plugin->Converted1Delay; l1DelaySample = (unsigned long)f1Delay; f1DelayOffset = f1Delay-(float)l1DelaySample; fLFOsamp1 = fLFO * f1Delay; f1DelayOld = plugin->Converted1Delay-f1DelayDelta; l1DelaySampleOld= (unsigned long)f1DelayOld; f1DelayOffsetOld= f1DelayOld-(float)l1DelaySampleOld; fLFOsamp1Old = fLFO * f1DelayOld; } if(f2DelayDelta==0.0) { HasDelay2Old = 0; f2Delay = plugin->Converted2Delay; l2DelaySample = (unsigned long)f2Delay; f2DelayOffset = f2Delay-(float)l2DelaySample; fLFOsamp2 = fLFO * f2Delay; f2DelayOld = 0.0; l2DelaySampleOld= 0; f2DelayOffsetOld= 0.0; fLFOsamp2Old = 0.0; } else { HasDelay2Old = 1; f2Delay = plugin->Converted2Delay; l2DelaySample = (unsigned long)f2Delay; f2DelayOffset = f2Delay-(float)l2DelaySample; fLFOsamp2 = fLFO * f2Delay; f2DelayOld = plugin->Converted2Delay-f2DelayDelta; l2DelaySampleOld= (unsigned long)f2DelayOld; f2DelayOffsetOld= f2DelayOld-(float)l2DelaySampleOld; fLFOsamp2Old = fLFO * f2DelayOld; } oldVol=0.0; newVol=1.0; f1PanLGain = f1Vol * (1-f1Pan)/2; f1PanRGain = f1Vol * (1+f1Pan)/2; f2PanLGain = f2Vol * (1-f2Pan)/2; f2PanRGain = f2Vol * (1+f2Pan)/2; if(fMungeMode < 0.5) { f1FB = f1FBraw / (1+fMunge); f2FB = f2FBraw / (1+fMunge); } else { f1FB = f1FBraw * pow(2.0,-2.0*fMunge); f2FB = f2FBraw * pow(2.0,-2.0*fMunge); } SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fAngle = plugin->LFOAngle; LPF1 = plugin->AudioLPF1; LPF2 = plugin->AudioLPF2; HPF1 = plugin->AudioHPF1; HPF2 = plugin->AudioHPF2; Degrain1 = plugin->AudioDegrain1; Degrain2 = plugin->AudioDegrain2; EnvIn = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { if(HasDelay1Old==1 || HasDelay2Old==1) { newVol = (float)lSampleIndex/(float)SampleCount; // 0 -> 1 oldVol = (float)(SampleCount-lSampleIndex)/(float)SampleCount; // 1 -> 0 } // read the audio out of the delay space Out1 = *(SpaceLCur); Out2 = *(SpaceRCur); // read the input In = *(pfAudioInputL++); // and mix the feedback in if(fMode<0.5 ) { // normal In1FBmix= In+(f1FB*Out1); In2FBmix= In+(f2FB*Out2); } else { //ping pong In1FBmix= In+(f2FB*Out2); In2FBmix= In+(f1FB*Out1); } // munge it In1FB = (1-fMunge)*In1FBmix + fMunge*ITube_do(In1FBmix,1+fMunge); In2FB = (1-fMunge)*In2FBmix + fMunge*ITube_do(In2FBmix,1+fMunge); HPF1 = ((fHPFsamples-1) * HPF1 + In1FB) / fHPFsamples; HPF2 = ((fHPFsamples-1) * HPF2 + In2FB) / fHPFsamples; LPF1 = ((fLPFsamples-1) * LPF1 + (In1FB-HPF1)) / fLPFsamples; LPF2 = ((fLPFsamples-1) * LPF2 + (In2FB-HPF2)) / fLPFsamples; if(fMungeMode<0.5) { In1Munged = LPF1; In2Munged = LPF2; } else { In1Munged = 2 * (In1FB-HPF1) - LPF1; In2Munged = 2 * (In2FB-HPF2) - LPF2; } Degrain1 = (In1Munged+(2*Degrain1))/3; Degrain2 = (In2Munged+(2*Degrain2))/3; // LFO if(fLFO > 0) { fActualDelay1 = f1Delay + (fLFOsamp1 * cos(fAngle)); l1DelaySample = (unsigned long)fActualDelay1; f1DelayOffset = fActualDelay1-(float)l1DelaySample; fActualDelay2 = f2Delay + (fLFOsamp2 * cos(fAngle)); l2DelaySample = (unsigned long)fActualDelay2; f2DelayOffset = fActualDelay2-(float)l2DelaySample; if(HasDelay1Old==1) { fActualDelay1Old = f1DelayOld + (fLFOsamp1Old * cos(fAngle)); l1DelaySampleOld = (unsigned long)fActualDelay1Old; f1DelayOffsetOld = fActualDelay1Old-(float)l1DelaySampleOld; } if(HasDelay2Old==1) { fActualDelay2Old = f2DelayOld + (fLFOsamp2Old * cos(fAngle)); l2DelaySampleOld = (unsigned long)fActualDelay2Old; f2DelayOffsetOld = fActualDelay2Old-(float)l2DelaySampleOld; } fAngle += fAngleDelta; } // add to the delay space if(HasDelay1Old==0) { SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySample, f1DelayOffset, Degrain1); } else { SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySample, f1DelayOffset, newVol*Degrain1); SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySampleOld, f1DelayOffsetOld, oldVol*Degrain1); } if(HasDelay2Old==0) { SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, l2DelaySample, f2DelayOffset, Degrain2); } else { SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, l2DelaySample, f2DelayOffset, newVol*Degrain2); SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l2DelaySampleOld, f2DelayOffsetOld, oldVol*Degrain2); } // mix the two delays in OutL = f1PanLGain*Out1 + f2PanLGain*Out2; OutR = f1PanRGain*Out1 + f2PanRGain*Out2; // write the output *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); //update any changing parameters if(HasDelta==1) { fMunge += fMungeDelta; fLPFsamples += fLPFDelta; fHPFsamples += fHPFDelta; fAngleDelta += fCycleDelta; fLFO += fWidthDelta; f1FBraw += fFB1Delta; f1Pan += fPan1Delta; f1Vol += fVol1Delta; f2FBraw += fFB2Delta; f2Pan += fPan2Delta; f2Vol += fVol2Delta; fLFOsamp1 = fLFO * f1Delay; fLFOsamp2 = fLFO * f2Delay; f1PanLGain = f1Vol * (1-f1Pan)/2; f1PanRGain = f1Vol * (1+f1Pan)/2; f2PanLGain = f2Vol * (1-f2Pan)/2; f2PanRGain = f2Vol * (1+f2Pan)/2; if(fMungeMode < 0.5) { f1FB = f1FBraw / (1+fMunge); f2FB = f2FBraw / (1+fMunge); } else { f1FB = f1FBraw * pow(2.0,-2.0*fMunge); f2FB = f2FBraw * pow(2.0,-2.0*fMunge); } if(HasDelay1Old==1) { fLFOsamp1Old = fLFO * f1DelayOld; } if(HasDelay2Old==1) { fLFOsamp2Old = fLFO * f2DelayOld; } } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *pfAudioInputL; *(pfAudioOutputR++) = *(pfAudioInputL++); // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero filters LPF1 =0; LPF2 =0; HPF1 =0; HPF2 =0; Degrain1 =0; Degrain2 =0; //zero envelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; } if(fLFO > 0) { while(fAngle > PI_2) { fAngle -= PI_2; } } else { fAngle=0; } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->LFOAngle = fAngle; plugin->AudioLPF1 = (fabs(LPF1)<1.0e-10) ? 0.f : LPF1; plugin->AudioLPF2 = (fabs(LPF2)<1.0e-10) ? 0.f : LPF2; plugin->AudioHPF1 = (fabs(HPF1)<1.0e-10) ? 0.f : HPF1; plugin->AudioHPF2 = (fabs(HPF2)<1.0e-10) ? 0.f : HPF2; plugin->AudioDegrain1 = (fabs(Degrain1)<1.0e-10) ? 0.f : Degrain1; plugin->AudioDegrain2 = (fabs(Degrain2)<1.0e-10) ? 0.f : Degrain2; plugin->EnvInLLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; // update the meters *(plugin->LampLFO) = 1.75*(1-(cos(fAngle))); *(plugin->MeterInputL) = (EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL) = (EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR) = (EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void runSumIDelay(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float In,Out1,Out2,OutL,OutR; float LPF1,LPF2,HPF1,HPF2,Degrain1,Degrain2; float EnvIn,EnvOutL,EnvOutR; float fBypass,fMode,fMunge,fMungeMode,fHPFsamples,fLPFsamples,fAngle,fAngleDelta,fLFO; float f1Delay,f1DelayOffset,fLFOsamp1,fActualDelay1; float f2Delay,f2DelayOffset,fLFOsamp2,fActualDelay2; float f1DelayDelta,f1DelayOld,f1DelayOffsetOld,fLFOsamp1Old,fActualDelay1Old; float f2DelayDelta,f2DelayOld,f2DelayOffsetOld,fLFOsamp2Old,fActualDelay2Old; float oldVol,newVol; float f1Vol,f1Pan,f1PanLGain,f1PanRGain,f1FBraw,f1FB,In1FB,In1FBmix,In1Munged; float f2Vol,f2Pan,f2PanLGain,f2PanRGain,f2FBraw,f2FB,In2FB,In2FBmix,In2Munged; double fMungeDelta,fLPFDelta,fHPFDelta,fCycleDelta,fWidthDelta,fFB1Delta,fPan1Delta,fVol1Delta,fFB2Delta,fPan2Delta,fVol2Delta; int HasDelta,HasDelay1Old,HasDelay2Old; unsigned long l1DelaySample, l2DelaySample; unsigned long l1DelaySampleOld, l2DelaySampleOld; unsigned long lSampleIndex; unsigned long SpaceSize; float * SpaceLStr; float * SpaceRStr; float * SpaceLCur; float * SpaceRCur; float * SpaceLEnd; float * SpaceREnd; IDelay *plugin = (IDelay *)instance; pParamFunc = &convertParam; /* check if any other params have changed */ checkParamChange(IDELAY_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(IDELAY_MODE, plugin->ControlMode, &(plugin->LastMode), &(plugin->ConvertedMode), plugin->SampleRate, pParamFunc); checkParamChange(IDELAY_MUNGEMODE, plugin->ControlMungeMode, &(plugin->LastMungeMode), &(plugin->ConvertedMungeMode), plugin->SampleRate, pParamFunc); fMungeDelta = getParamChange(IDELAY_MUNGE, plugin->ControlMunge, &(plugin->LastMunge), &(plugin->ConvertedMunge), plugin->SampleRate, pParamFunc); fCycleDelta = getParamChange(IDELAY_LFO_CYCLE, plugin->ControlCycle, &(plugin->LastCycle), &(plugin->ConvertedCycle), plugin->SampleRate, pParamFunc); fWidthDelta = getParamChange(IDELAY_LFO_WIDTH, plugin->ControlWidth, &(plugin->LastWidth), &(plugin->ConvertedWidth), plugin->SampleRate, pParamFunc); f1DelayDelta = getParamChange(IDELAY_1_DELAY, plugin->Control1Delay, &(plugin->Last1Delay), &(plugin->Converted1Delay), plugin->SampleRate, pParamFunc); fFB1Delta = getParamChange(IDELAY_1_FB, plugin->Control1FB, &(plugin->Last1FB), &(plugin->Converted1FB), plugin->SampleRate, pParamFunc); fPan1Delta = getParamChange(IDELAY_1_PAN, plugin->Control1Pan, &(plugin->Last1Pan), &(plugin->Converted1Pan), plugin->SampleRate, pParamFunc); fVol1Delta = getParamChange(IDELAY_1_VOL, plugin->Control1Vol, &(plugin->Last1Vol), &(plugin->Converted1Vol), plugin->SampleRate, pParamFunc); f2DelayDelta = getParamChange(IDELAY_2_DELAY, plugin->Control2Delay, &(plugin->Last2Delay), &(plugin->Converted2Delay), plugin->SampleRate, pParamFunc); fFB2Delta = getParamChange(IDELAY_2_FB, plugin->Control2FB, &(plugin->Last2FB), &(plugin->Converted2FB), plugin->SampleRate, pParamFunc); fPan2Delta = getParamChange(IDELAY_2_PAN, plugin->Control2Pan, &(plugin->Last2Pan), &(plugin->Converted2Pan), plugin->SampleRate, pParamFunc); fVol2Delta = getParamChange(IDELAY_2_VOL, plugin->Control2Vol, &(plugin->Last2Vol), &(plugin->Converted2Vol), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fMode = plugin->ConvertedMode; fMungeMode = plugin->ConvertedMungeMode; if(fMungeDelta==0 && fCycleDelta == 0 && fWidthDelta==0 && fFB1Delta==0 && fFB2Delta==0 && fPan1Delta==0 && fPan2Delta==0 && fVol1Delta==0 && fVol2Delta==0) { HasDelta=0; fMunge = plugin->ConvertedMunge; fLPFDelta = 0.0; fHPFDelta = 0.0; fLPFsamples = plugin->ConvertedLPFsamples; fHPFsamples = plugin->ConvertedHPFsamples; fAngleDelta = plugin->ConvertedCycle; fLFO = plugin->ConvertedWidth; f1FBraw = plugin->Converted1FB; f1Pan = plugin->Converted1Pan; f1Vol = plugin->Converted1Vol; f2FBraw = plugin->Converted2FB; f2Pan = plugin->Converted2Pan; f2Vol = plugin->Converted2Vol; } else { HasDelta = 1; fMunge = plugin->ConvertedMunge - fMungeDelta; if(fMungeDelta == 0) { fLPFDelta = 0.0; fHPFDelta = 0.0; } else { // this is a bit wonky i know but creating varibles for the old values and then calculating the delta with new-old doesn't save any cpu fLPFDelta = -plugin->ConvertedLPFsamples; fHPFDelta = -plugin->ConvertedHPFsamples; plugin->ConvertedLPFsamples = convertMunge(0, plugin->LastMunge, plugin->SampleRate); plugin->ConvertedHPFsamples = convertMunge(1, plugin->LastMunge, plugin->SampleRate); fLPFDelta += plugin->ConvertedLPFsamples; fHPFDelta += plugin->ConvertedHPFsamples; } fLPFsamples = plugin->ConvertedLPFsamples - fLPFDelta; fHPFsamples = plugin->ConvertedHPFsamples - fHPFDelta; fAngleDelta = plugin->ConvertedCycle - fCycleDelta; fLFO = plugin->ConvertedWidth - fWidthDelta; f1FBraw = plugin->Converted1FB - fFB1Delta; f1Pan = plugin->Converted1Pan - fPan1Delta; f1Vol = plugin->Converted1Vol - fVol1Delta; f2FBraw = plugin->Converted2FB - fFB2Delta; f2Pan = plugin->Converted2Pan - fPan2Delta; f2Vol = plugin->Converted2Vol - fVol2Delta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fLPFDelta = fLPFDelta/(float)SampleCount; fHPFDelta = fHPFDelta/(float)SampleCount; fMungeDelta = fMungeDelta/(float)SampleCount; fCycleDelta = fCycleDelta/(float)SampleCount; fWidthDelta = fWidthDelta/(float)SampleCount; fFB1Delta = fFB1Delta/(float)SampleCount; fPan1Delta = fPan1Delta/(float)SampleCount; fVol1Delta = fVol1Delta/(float)SampleCount; fFB2Delta = fFB2Delta/(float)SampleCount; fPan2Delta = fPan2Delta/(float)SampleCount; fVol2Delta = fVol2Delta/(float)SampleCount; } } if(f1DelayDelta==0.0) { HasDelay1Old = 0; f1Delay = plugin->Converted1Delay; l1DelaySample = (unsigned long)f1Delay; f1DelayOffset = f1Delay-(float)l1DelaySample; fLFOsamp1 = fLFO * f1Delay; f1DelayOld = 0.0; l1DelaySampleOld= 0; f1DelayOffsetOld= 0.0; fLFOsamp1Old = 0.0; } else { HasDelay1Old = 1; f1Delay = plugin->Converted1Delay; l1DelaySample = (unsigned long)f1Delay; f1DelayOffset = f1Delay-(float)l1DelaySample; fLFOsamp1 = fLFO * f1Delay; f1DelayOld = plugin->Converted1Delay-f1DelayDelta; l1DelaySampleOld= (unsigned long)f1DelayOld; f1DelayOffsetOld= f1DelayOld-(float)l1DelaySampleOld; fLFOsamp1Old = fLFO * f1DelayOld; } if(f2DelayDelta==0.0) { HasDelay2Old = 0; f2Delay = plugin->Converted2Delay; l2DelaySample = (unsigned long)f2Delay; f2DelayOffset = f2Delay-(float)l2DelaySample; fLFOsamp2 = fLFO * f2Delay; f2DelayOld = 0.0; l2DelaySampleOld= 0; f2DelayOffsetOld= 0.0; fLFOsamp2Old = 0.0; } else { HasDelay2Old = 1; f2Delay = plugin->Converted2Delay; l2DelaySample = (unsigned long)f2Delay; f2DelayOffset = f2Delay-(float)l2DelaySample; fLFOsamp2 = fLFO * f2Delay; f2DelayOld = plugin->Converted2Delay-f2DelayDelta; l2DelaySampleOld= (unsigned long)f2DelayOld; f2DelayOffsetOld= f2DelayOld-(float)l2DelaySampleOld; fLFOsamp2Old = fLFO * f2DelayOld; } oldVol=0.0; newVol=1.0; f1PanLGain = f1Vol * (1-f1Pan)/2; f1PanRGain = f1Vol * (1+f1Pan)/2; f2PanLGain = f2Vol * (1-f2Pan)/2; f2PanRGain = f2Vol * (1+f2Pan)/2; if(fMungeMode < 0.5) { f1FB = f1FBraw / (1+fMunge); f2FB = f2FBraw / (1+fMunge); } else { f1FB = f1FBraw * pow(2.0,-2.0*fMunge); f2FB = f2FBraw * pow(2.0,-2.0*fMunge); } SpaceSize = plugin->SpaceSize; SpaceLStr = plugin->SpaceL; SpaceRStr = plugin->SpaceR; SpaceLCur = plugin->SpaceLCur; SpaceRCur = plugin->SpaceRCur; SpaceLEnd = plugin->SpaceLEnd; SpaceREnd = plugin->SpaceREnd; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; fAngle = plugin->LFOAngle; LPF1 = plugin->AudioLPF1; LPF2 = plugin->AudioLPF2; HPF1 = plugin->AudioHPF1; HPF2 = plugin->AudioHPF2; Degrain1 = plugin->AudioDegrain1; Degrain2 = plugin->AudioDegrain2; EnvIn = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { if(HasDelay1Old==1 || HasDelay2Old==1) { newVol = (float)lSampleIndex/(float)SampleCount; // 0 -> 1 oldVol = (float)(SampleCount-lSampleIndex)/(float)SampleCount; // 1 -> 0 } // read the audio out of the delay space Out1 = *(SpaceLCur); Out2 = *(SpaceRCur); // now read the input In=( *(pfAudioInputL++) + *(pfAudioInputR++) )/2; // and mix the feedback in if(fMode<0.5 ) { // normal In1FBmix= In+(f1FB*Out1); In2FBmix= In+(f2FB*Out2); } else { //ping pong In1FBmix= In+(f2FB*Out2); In2FBmix= In+(f1FB*Out1); } // munge it In1FB = (1-fMunge)*In1FBmix + fMunge*ITube_do(In1FBmix,1+fMunge); In2FB = (1-fMunge)*In2FBmix + fMunge*ITube_do(In2FBmix,1+fMunge); HPF1 = ((fHPFsamples-1) * HPF1 + In1FB) / fHPFsamples; HPF2 = ((fHPFsamples-1) * HPF2 + In2FB) / fHPFsamples; LPF1 = ((fLPFsamples-1) * LPF1 + (In1FB-HPF1)) / fLPFsamples; LPF2 = ((fLPFsamples-1) * LPF2 + (In2FB-HPF2)) / fLPFsamples; if(fMungeMode<0.5) { In1Munged = LPF1; In2Munged = LPF2; } else { In1Munged = 2 * (In1FB-HPF1) - LPF1; In2Munged = 2 * (In2FB-HPF2) - LPF2; } Degrain1 = (In1Munged+(1.1*Degrain1))/2.1; Degrain2 = (In2Munged+(1.1*Degrain2))/2.1; //LFO if(fLFO > 0) { fActualDelay1 = f1Delay + (fLFOsamp1 * cos(fAngle)); l1DelaySample = (unsigned long)fActualDelay1; f1DelayOffset = fActualDelay1-(float)l1DelaySample; fActualDelay2 = f2Delay + (fLFOsamp2 * cos(fAngle)); l2DelaySample = (unsigned long)fActualDelay2; f2DelayOffset = fActualDelay2-(float)l2DelaySample; if(HasDelay1Old==1) { fActualDelay1Old = f1DelayOld + (fLFOsamp1Old * cos(fAngle)); l1DelaySampleOld = (unsigned long)fActualDelay1Old; f1DelayOffsetOld = fActualDelay1Old-(float)l1DelaySampleOld; } if(HasDelay2Old==1) { fActualDelay2Old = f2DelayOld + (fLFOsamp2Old * cos(fAngle)); l2DelaySampleOld = (unsigned long)fActualDelay2Old; f2DelayOffsetOld = fActualDelay2Old-(float)l2DelaySampleOld; } fAngle += fAngleDelta; } // add to the delay space if(HasDelay1Old==0) { SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySample, f1DelayOffset, Degrain1); } else { SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySample, f1DelayOffset, newVol*Degrain1); SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l1DelaySampleOld, f1DelayOffsetOld, oldVol*Degrain1); } if(HasDelay2Old==0) { SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, l2DelaySample, f2DelayOffset, Degrain2); } else { SpaceAdd(SpaceRCur, SpaceREnd, SpaceSize, l2DelaySample, f2DelayOffset, newVol*Degrain2); SpaceAdd(SpaceLCur, SpaceLEnd, SpaceSize, l2DelaySampleOld, f2DelayOffsetOld, oldVol*Degrain2); } // mix the two delays in OutL = f1PanLGain*Out1 + f2PanLGain*Out2; OutR = f1PanRGain*Out1 + f2PanRGain*Out2; // write the output *(pfAudioOutputL++) = OutL; *(pfAudioOutputR++) = OutR; // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; //evelope on in and out for meters EnvIn += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], In, EnvIn); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); //update any changing parameters if(HasDelta==1) { fMunge += fMungeDelta; fLPFsamples += fLPFDelta; fHPFsamples += fHPFDelta; fAngleDelta += fCycleDelta; fLFO += fWidthDelta; f1FBraw += fFB1Delta; f1Pan += fPan1Delta; f1Vol += fVol1Delta; f2FBraw += fFB2Delta; f2Pan += fPan2Delta; f2Vol += fVol2Delta; fLFOsamp1 = fLFO * f1Delay; fLFOsamp2 = fLFO * f2Delay; f1PanLGain = f1Vol * (1-f1Pan)/2; f1PanRGain = f1Vol * (1+f1Pan)/2; f2PanLGain = f2Vol * (1-f2Pan)/2; f2PanRGain = f2Vol * (1+f2Pan)/2; if(fMungeMode < 0.5) { f1FB = f1FBraw / (1+fMunge); f2FB = f2FBraw / (1+fMunge); } else { f1FB = f1FBraw * pow(2.0,-2.0*fMunge); f2FB = f2FBraw * pow(2.0,-2.0*fMunge); } if(HasDelay1Old==1) { fLFOsamp1Old = fLFO * f1DelayOld; } if(HasDelay2Old==1) { fLFOsamp2Old = fLFO * f2DelayOld; } } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *pfAudioInputL; *(pfAudioOutputR++) = *(pfAudioInputL++); // zero the spot we just read *(SpaceLCur)=0; *(SpaceRCur)=0; // advance the pointer to the next spot SpaceLCur = SpaceLCur < SpaceLEnd ? SpaceLCur + 1 : SpaceLStr; SpaceRCur = SpaceRCur < SpaceREnd ? SpaceRCur + 1 : SpaceRStr; } //zero filters LPF1 =0; LPF2 =0; HPF1 =0; HPF2 =0; Degrain1 =0; Degrain2 =0; //zero envelope on in and out for meters EnvIn =0; EnvOutL =0; EnvOutR =0; } if(fLFO > 0) { while(fAngle > PI_2) { fAngle -= PI_2; } } else { fAngle=0; } // remember for next run plugin->SpaceLCur=SpaceLCur; plugin->SpaceRCur=SpaceRCur; plugin->LFOAngle = fAngle; plugin->AudioLPF1 = (fabs(LPF1)<1.0e-10) ? 0.f : LPF1; plugin->AudioLPF2 = (fabs(LPF2)<1.0e-10) ? 0.f : LPF2; plugin->AudioHPF1 = (fabs(HPF1)<1.0e-10) ? 0.f : HPF1; plugin->AudioHPF2 = (fabs(HPF2)<1.0e-10) ? 0.f : HPF2; plugin->AudioDegrain1 = (fabs(Degrain1)<1.0e-10) ? 0.f : Degrain1; plugin->AudioDegrain2 = (fabs(Degrain2)<1.0e-10) ? 0.f : Degrain2; plugin->EnvInLLast = (fabs(EnvIn)<1.0e-10) ? 0.f : EnvIn; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; // update the meters *(plugin->LampLFO) = 1.75*(1-(cos(fAngle))); *(plugin->MeterInputL) =(EnvIn > 0.001) ? 20*log10(EnvIn) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; } static void cleanupIDelay(LV2_Handle instance) { IDelay *plugin = (IDelay *)instance; free(plugin->SpaceL); free(plugin->SpaceR); free(instance); } static void init() { IDelayMonoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IDelayMonoDescriptor->URI = IDELAY_MONO_URI; IDelayMonoDescriptor->activate = activateIDelay; IDelayMonoDescriptor->cleanup = cleanupIDelay; IDelayMonoDescriptor->connect_port = connectPortIDelay; IDelayMonoDescriptor->deactivate = NULL; IDelayMonoDescriptor->instantiate = instantiateIDelay; IDelayMonoDescriptor->run = runMonoIDelay; IDelayMonoDescriptor->extension_data = NULL; IDelaySumDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IDelaySumDescriptor->URI = IDELAY_SUM_URI; IDelaySumDescriptor->activate = activateIDelay; IDelaySumDescriptor->cleanup = cleanupIDelay; IDelaySumDescriptor->connect_port = connectPortIDelay; IDelaySumDescriptor->deactivate = NULL; IDelaySumDescriptor->instantiate = instantiateIDelay; IDelaySumDescriptor->run = runSumIDelay; IDelaySumDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IDelayMonoDescriptor) init(); switch (index) { case 0: return IDelayMonoDescriptor; case 1: return IDelaySumDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IDELAY_BYPASS: case IDELAY_MODE: case IDELAY_MUNGEMODE: if(value<=0.0) result= 0; else result= 1; break; case IDELAY_MUNGE: if(value<0) result = 0.0; else if (value < 100) result = value/100.0; else result = 1.0; break; case IDELAY_LFO_CYCLE: if (value < 2.0) result = PI_2/(2.0*sr); else if (value <= 200.0) result = PI_2/(value * sr); else result = PI_2/(200.0 * sr); break; case IDELAY_1_DELAY: case IDELAY_2_DELAY: if (value < 0.02) result = 0.02 * sr; else if (value <= 2.0) result = value * sr; else result = 2.0 * sr; break; case IDELAY_1_FB: case IDELAY_2_FB: if(value<0) result = 0.0; else if (value < 133.333333) result = value/100.0; else result = 1.3333333; break; case IDELAY_1_PAN: case IDELAY_2_PAN: if(value<-1.0) result = -1.0; else if (value < 1.0) result = value; else result = 1.0; break; case IDELAY_LFO_WIDTH: if(value<0.0) result = 0.0; else if (value < 100.0) result = value/400.0; else result = 0.25; break; case IDELAY_1_VOL: case IDELAY_2_VOL: if(value<0.0) result = 0.0; else if (value < 100.0) result = value/100.0; else result = 1.0; break; default: result=0; break; } return result; } float convertMunge (unsigned int mode, float munge, double sr) { float result; switch(mode) { case 0: //LPF if (munge < 0) result = sr/(2*pow(10,(4.34))); //22kHz else if (munge <= 100.0) result = sr/(2*pow(10,(4.34-(munge*0.0074)))); else result = sr/(2*pow(10,(3.60))); //4kHz break; case 1: //HPF if (munge < 0) result = sr/(2*pow(10,(1.30))); //20Hz else if (munge <= 100.0) result = sr/(2*pow(10,(1.30+(munge*0.0160)))); else result = sr/(2*pow(10,(2.90))); //800Hz break; default: result=1; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/library/0000775000175000017500000000000011251515772021273 5ustar alessioalessioinvada-studio-plugins-lv2-1.2.0/plugin/library/common.c0000664000175000017500000004110311251515772022726 0ustar alessioalessio/* Common functions (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "common.h" /* a function that checks to see if a control has been changed and calls the provided conversion fuction */ void checkParamChange( unsigned long param, float * control, float * last, float * converted, double sr, float (*ConvertFunction)(unsigned long, float, double) ) { if(*control != *last) { *last=*control; *converted=(*ConvertFunction)(param, *control, sr); } } float getParamChange( unsigned long param, float * control, float * last, float * converted, double sr, float (*ConvertFunction)(unsigned long, float, double) ) { float delta; float old; if(*control != *last) { old = *converted; *last=*control; *converted=(*ConvertFunction)(param, *control, sr); delta=*converted-old; } else { delta=0.0; } return delta; } /* a function which maps an envelope to a sound */ void initIEnvelope(struct Envelope * Env, int mode, double sr) { switch(mode) { case INVADA_METER_VU: Env->attack = 1 - pow(10, -301.0301 / ((float)sr * 150.0)); Env->decay = Env->attack; break; case INVADA_METER_PEAK: Env->attack = 1 - pow(10, -301.0301 / ((float)sr * 0.5)); Env->decay = 1 - pow(10, -301.0301 / ((float)sr * 100.0)); break; case INVADA_METER_PHASE: Env->attack = 1 - pow(10, -301.0301 / ((float)sr * 20.0)); Env->decay = Env->attack; break; case INVADA_METER_LAMP: Env->attack = 1 - pow(10, -301.0301 / ((float)sr * 10.0)); Env->decay = 1 - pow(10, -301.0301 / ((float)sr * 100.0)); break; } } float applyIEnvelope(struct Envelope * Env, float audio_value, float envelope_value) { float valueA; valueA=fabs(audio_value); return (valueA > envelope_value) ? Env->attack * (valueA - envelope_value) : Env->decay * (valueA - envelope_value); } void SpaceAdd(float *SpacePos, float *SpaceEnd, unsigned long SpaceSize, unsigned long Delay, float Offset, float Value) { if(SpacePos+Delay > SpaceEnd) *(SpacePos+Delay-SpaceSize) +=Value*(1-Offset); else *(SpacePos+Delay) +=Value*(1-Offset); if(SpacePos+Delay+1 > SpaceEnd) *(SpacePos+Delay-SpaceSize+1) +=Value*Offset; else *(SpacePos+Delay+1) +=Value*Offset; } void SpaceSub(float *SpacePos, float *SpaceEnd, unsigned long SpaceSize, unsigned long Delay, float Offset, float Value) { if(SpacePos+Delay > SpaceEnd) *(SpacePos+Delay-SpaceSize) -=Value*(1-Offset); else *(SpacePos+Delay) -=Value*(1-Offset); if(SpacePos+Delay+1 > SpaceEnd) *(SpacePos+Delay-SpaceSize+1) -=Value*Offset; else *(SpacePos+Delay+1) -=Value*Offset; } /* this function is linear between -0.7 & 0.7 (approx -3db) and returns a value bewteen 0.7 and 1 for an input from 0.7 to infinity */ float InoClip(float in, float * drive) { float out; if ( fabs(in) < 0.7 ) { out = in; *drive=0; } else { out = (in>0) ? ( 0.7 + 0.3 * (1-pow(2.718281828, 3.33333333*(0.7-in)))): ( -0.7 - 0.3 * (1-pow(2.718281828, 3.33333333*(0.7+in)))); *drive=fabs(in) - fabs(out); /* out is always going to be lower than in */ } return out; } /* distortion function based on sin() */ float ITube_do(float in, float Drive) { float out; out = (in>0) ? pow( fabs(sin( in*Drive*PI_ON_2)),ITUBE_MAGIC ) : -pow( fabs(sin(-in*Drive*PI_ON_2)),ITUBE_MAGIC ) ; return out; } void calculateSingleIReverbER(struct ERunit * er, float Width, float Length, float Height, int Phase, unsigned int Reflections, float DDist, double sr) { float ERAngle,ERDistanceSQRD,ERDistance,ERRelDelayActual,ERRelGain,ERRelGainL,ERRelGainR; ERAngle = atan(Width/Length); ERDistanceSQRD = pow(Length,2) + pow(Width,2)+ pow(Height,2); ERDistance = sqrt(ERDistanceSQRD); ERRelDelayActual = ((ERDistance-DDist) * (float)sr /SPEED_OF_SOUND); ERRelGain = Phase / ERDistanceSQRD; ERRelGainL = (ERRelGain * (1 - (ERAngle/PI_ON_2)))/2; ERRelGainR = (ERRelGain * (1 + (ERAngle/PI_ON_2)))/2; er->Active=1; er->rand=drand48(); er->DelayActual=ERRelDelayActual; er->Reflections=Reflections; er->AbsGain=fabs(ERRelGain); er->GainL=ERRelGainL; er->GainR=ERRelGainR; } int calculateIReverbER(struct ERunit *erarray, int erMax, float width, float length, float height, float sourceLR, float sourceFB, float destLR, float destFB, float objectHeight, float diffusion, double sr) { float SourceToLeft,SourceToRight,SourceToRear,SourceToFront; float DestToLeft,DestToRight,DestToRear,DestToFront; float RoofHeight,FloorDepth; float DirectLength,DirectWidth,DirectHeight,DirectDistanceSQRD,DirectDistance; float ERLength,ERWidth,ERHeight,MaxGain; struct ERunit *er, *er2; unsigned int Num,TotalNum,i; SourceToLeft = (1+sourceLR) /2 * width; SourceToRight= (1-sourceLR) /2 * width; SourceToFront= sourceFB * length; SourceToRear = (1-sourceFB) * length; DestToLeft = (1+destLR) /2 * width; DestToRight= (1-destLR) /2 * width; DestToFront= destFB * length; DestToRear = (1-destFB) * length; RoofHeight = height - objectHeight; FloorDepth = objectHeight; DirectLength = SourceToFront-DestToFront; DirectWidth = SourceToLeft-DestToLeft; DirectHeight =0; // both the source and the lisenter are at the same height DirectDistanceSQRD = pow(DirectLength,2)+pow(DirectWidth,2) < 1 ? 1 : pow(DirectLength,2)+pow(DirectWidth,2); DirectDistance = sqrt(DirectDistanceSQRD) < 1 ? 1 : sqrt(DirectDistanceSQRD); er=erarray; Num=0; MaxGain=0.000000000001; /* this is used to scale up the reflections so that the loudest one has a gain of 1 (0db) */ /* seed the random sequence*/ srand48(314159265); // reflections from the left wall // 0: S->Left->D ERLength = DirectLength; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 1, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 1: S->BackWall->Left->D ERLength = SourceToRear + DestToRear; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 2: S->Right->Left->D ERLength = DirectLength; ERWidth = -(SourceToRight + width + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 3: S->BackWall->Right->Left->D ERLength = SourceToRear + DestToRear; ERWidth = -(SourceToRight + width + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 4: S->Left->Rigth->Left->D ERLength = DirectLength; ERWidth = -(SourceToLeft + (2 * width) + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 5: S->BackWall->Left->Right->Left->D ERLength = SourceToRear + DestToRear; ERWidth = -(SourceToLeft + (2 * width) + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 4, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // reflections from the right wall // 6: S->Right->D ERLength = DirectLength; ERWidth = SourceToRight + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 1, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 7: S->BackWall->Right->D ERLength = SourceToRear + DestToRear; ERWidth = SourceToRight + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 8: S->Left->Right->D ERLength = DirectLength; ERWidth = SourceToLeft + width + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 9: S->BackWall->Left->Right->D ERLength = SourceToRear + DestToRear; ERWidth = SourceToLeft + width + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 10: S->Right->Left->Right->D ERLength = DirectLength; ERWidth = SourceToRight + (2 * width) + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 11: S->BackWall->Right->Left->Right->D ERLength = SourceToRear + DestToRear; ERWidth = SourceToRight + (2 * width) + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 4, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // reflections from the rear wall // 12: S->BackWall->D ERLength = SourceToRear + DestToRear; ERWidth = DirectWidth; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 1, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 13: S->NearWall->BackWall->D ERLength = SourceToFront + length + DestToRear; ERWidth = DirectWidth; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 14: S->Left->NearWall->BackWall->D ERLength = SourceToFront + length + DestToRear; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 15: S->Right->NearWall->BackWall->D ERLength = SourceToFront + length + DestToRear; ERWidth = SourceToRight + DestToRight; ERHeight = DirectHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // reflections from the roof // 16: S->Roof->Left->D ERLength = DirectLength; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = 2*RoofHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 17: S->Roof->Right->D ERLength = DirectLength; ERWidth = SourceToRight + DestToRight; ERHeight = 2*RoofHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 1, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 18: S->BackWall->Roof->Left->D ERLength = SourceToRear + DestToRear; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = 2*RoofHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 19: S->BackWall->Roof->Right->D ERLength = SourceToRear + DestToRear; ERWidth = SourceToRight + DestToRight; ERHeight = 2*RoofHeight; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance,sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // reflections from the floor // 20: S->Floor->Left->D ERLength = DirectLength; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 21: S->Floor->Right->D ERLength = DirectLength; ERWidth = SourceToRight + DestToRight; ERHeight = 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, 1, 2, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // reflections from roof and floor // 22: S->Roof->Left->Floor->D ERLength = DirectLength; ERWidth = -(SourceToLeft + DestToLeft); ERHeight = 2*RoofHeight + 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 23: S->Roof->Right->Floor->D ERLength = DirectLength; ERWidth = SourceToRight + DestToRight; ERHeight = 2*RoofHeight + 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 3, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 24: S->Roof->Left->Floor->Right->Roof->D ERLength = DirectLength; ERWidth = -(SourceToLeft + DirectWidth + DestToLeft); ERHeight = 4*RoofHeight + 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 5, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; // 25: S->Roof->Right->Floor->Left->Roof->D ERLength = DirectLength; ERWidth = SourceToRight + DirectWidth + DestToRight; ERHeight = 4*RoofHeight + 2*FloorDepth; calculateSingleIReverbER(er, ERWidth, ERLength, ERHeight, -1, 5, DirectDistance, sr); if(er->AbsGain > MaxGain) MaxGain=er->AbsGain; er++; Num++; er2=er; er=erarray; TotalNum=Num; for(i=0;i 0 && 4*er->AbsGain/MaxGain > 1-diffusion) { er2->Active=1; er2->rand=er->rand; er2->DelayActual=er->DelayActual*(1.085+(er->rand*diffusion/7)); er2->Delay = (unsigned long)er2->DelayActual; er2->DelayOffset = er2->DelayActual - (float)er2->Delay; er2->Reflections=er->Reflections; er2->AbsGain=er->AbsGain*diffusion*0.6/MaxGain; er2->GainL=er->GainL*diffusion*0.6/MaxGain; er2->GainR=er->GainR*diffusion*0.6/MaxGain; TotalNum++; er2++; } //scale up reflection and calculate sample delay er->DelayActual=er->DelayActual*(1.01+(er->rand*diffusion/14)); er->Delay = (unsigned long)er->DelayActual; er->DelayOffset = er->DelayActual - (float)er->Delay; er->AbsGain=er->AbsGain/MaxGain; er->GainL=er->GainL/MaxGain; er->GainR=er->GainR/MaxGain; er++; } return TotalNum; } void initBandpassFilter(struct FilterP *f, double sr, double cf, double bw) { int i; double w0,alpha,a0,a1,a2,b0,b1,b2; if(cf sr/2.0) { bw= ( (bw) + ((sr/(2*cf)) -1.0) )/2; } f->Active=1; for(i=0;i<3;i++) { f->x[i] = 0.0; f->x2[i] = 0.0; f->y[i] = 0.0; f->y2[i] = 0.0; } w0 = PI_2*cf/sr; alpha = sin(w0)*sinh((log(2)/2) * bw * (w0/sin(w0))) ; b0 = alpha; b1 = 0; b2 = -alpha; a0 = 1 + alpha; a1 = -2*cos(w0); a2 = 1 - alpha; f->i[0]=b0/a0; f->i[1]=b1/a0; f->i[2]=b2/a0; f->i[3]=a1/a0; f->i[4]=a2/a0; } else { f->Active=0; } return; } float applyBandpassFilter(struct FilterP *f, float in) { int i; if(f->Active==1) { for(i=0;i<2;i++) { f->x[i] = f->x[i+1]; f->x2[i] = f->x2[i+1]; f->y[i] = f->y[i+1]; f->y2[i] = f->y2[i+1]; } f->x[2] = (double)in; f->y[2] = f->i[0]*f->x[2] + f->i[1]*f->x[1] + f->i[2]*f->x[0] - f->i[3]*f->y[1] - f->i[4]*f->y[0]; f->x2[2] = f->y[2]; f->y2[2] = f->i[0]*f->x2[2] + f->i[1]*f->x2[1] + f->i[2]*f->x2[0] - f->i[3]*f->y2[1] - f->i[4]*f->y2[0]; return (float)f->y2[2]; } else { return 0; } } invada-studio-plugins-lv2-1.2.0/plugin/library/common.h0000664000175000017500000000640611251515772022742 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INVADA_COMMON_H #define __INVADA_COMMON_H /* 2.0 * atan(1.0) */ #define PI_ON_2 1.570796327 /* PI */ #define PI 3.1415926535877932 /* 2*PI */ #define PI_2 6.2831853071795864 /* -1.0 / log10(sin(0.2 * atan(1.0))) */ #define ITUBE_MAGIC 1.241206735 /*2^31-2 */ #define TWO31_MINUS2 2147483646 /* maximun number of early reflections to calculate */ #define MAX_ER 100 /* speed of sound in air in meters/second */ #define SPEED_OF_SOUND 330 #define INVADA_METER_VU 0 #define INVADA_METER_PEAK 1 #define INVADA_METER_PHASE 2 #define INVADA_METER_LAMP 3 struct Envelope { float attack; float decay; }; struct ERunit { int Active; float rand; float DelayActual; float DelayOffset; unsigned long Delay; unsigned int Reflections; float AbsGain; float GainL; float GainR; }; struct FilterP { int Active; double x[3]; double x2[3]; double y[3]; double y2[3]; double i[5]; }; /* param change detect functions, second one calculates deltas for interpolation in run loops */ void checkParamChange(unsigned long param, float * control, float * last, float * converted, double sr, float (*ConvertFunction)(unsigned long, float, double)); float getParamChange(unsigned long param, float * control, float * last, float * converted, double sr, float (*ConvertFunction)(unsigned long, float, double)); /* audio envelope */ void initIEnvelope(struct Envelope * Env, int mode, double sr); float applyIEnvelope(struct Envelope * Env, float value, float envelope); /* add or subtract to delay space */ void SpaceAdd(float *SpacePos, float *SpaceEnd, unsigned long SpaceSize, unsigned long Delay, float Offset, float Value); void SpaceSub(float *SpacePos, float *SpaceEnd, unsigned long SpaceSize, unsigned long Delay, float Offset, float Value); /* soft clipping function */ float InoClip(float in, float *drive); /* distortion function */ float ITube_do(float in, float Drive); /* works out a single er reflection */ void calculateSingleIReverbER(struct ERunit * er, float Width, float Length, float Height, int Phase, unsigned int reflections, float DDist, double sr); /* works out all er reflections */ int calculateIReverbER(struct ERunit *erarray, int erMax, float width, float length, float height, float sourceLR, float sourceFB, float destLR, float destFB, float objectHeight, float diffusion, double sr); /* Butterworth bandpass for spectral analysier */ void initBandpassFilter(struct FilterP *f, double sr, double cf, double bw); float applyBandpassFilter(struct FilterP *f, float in); #endif /*__INVADA_COMMON_H */ invada-studio-plugins-lv2-1.2.0/plugin/library/Makefile0000664000175000017500000000233711251515772022740 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # GENERAL CC = gcc LD = ld CFLAGS = -I. -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC all: libinv_common.a # RULES TO BUILD LIBRARIES FROM C CODE libinv_common.a: common.o common.h @echo "Creating libinv_common.a" @ar rcs libinv_common.a common.o # OTHER TARGETS targets: libinv_common.a always: clean: -rm -f *.a -rm -f *.o -rm -f *~ %.o: %.c @echo "Compiling $<" @$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ invada-studio-plugins-lv2-1.2.0/plugin/inv_compressor.c0000664000175000017500000004741311251515772023054 0ustar alessioalessio/* This LV2 plugin provides a mono and stereo compressor. (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "library/common.h" #include "inv_compressor.h" static LV2_Descriptor *ICompMonoDescriptor = NULL; static LV2_Descriptor *ICompStereoDescriptor = NULL; typedef struct { /* Ports */ float * ControlBypass; float * ControlRms; float * ControlAttack; float * ControlRelease; float * ControlThresh; float * ControlRatio; float * ControlGain; float * ControlNoClip; float * ControlMeter; float * AudioInputBufferL; float * AudioOutputBufferL; float * AudioInputBufferR; float * AudioOutputBufferR; float * MeterInputL; float * MeterOutputL; float * MeterInputR; float * MeterOutputR; float * MeterDrive; double SampleRate; struct Envelope EnvAD[4]; /* these params are used to remember the control values and the converted (internal) value to save a bit of cpu converting them every run */ float LastBypass; float LastRms; float LastAttack; float LastRelease; float LastThresh; float LastRatio; float LastGain; float LastNoClip; float ConvertedBypass; float ConvertedRms; float ConvertedAttack; float ConvertedRelease; float ConvertedThresh; float ConvertedRatio; float ConvertedGain; float ConvertedNoClip; float EnvInLLast; float EnvOutLLast; float EnvInRLast; float EnvOutRLast; float EnvDriveLast; /* this stuff needs to be remembered between run calls */ float Envelope; float Rms; } IComp; static LV2_Handle instantiateIComp(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IComp *plugin = (IComp *)malloc(sizeof(IComp)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; return (LV2_Handle)plugin; } static void connectPortIComp(LV2_Handle instance, uint32_t port, void *data) { IComp *plugin = (IComp *)instance; switch (port) { case ICOMP_BYPASS: plugin->ControlBypass = data; break; case ICOMP_RMS: plugin->ControlRms = data; break; case ICOMP_ATTACK: plugin->ControlAttack = data; break; case ICOMP_RELEASE: plugin->ControlRelease = data; break; case ICOMP_THRESH: plugin->ControlThresh = data; break; case ICOMP_RATIO: plugin->ControlRatio = data; break; case ICOMP_GAIN: plugin->ControlGain = data; break; case ICOMP_NOCLIP: plugin->ControlNoClip = data; break; case ICOMP_METER_GR: plugin->ControlMeter = data; break; case ICOMP_AUDIO_INPUTL: plugin->AudioInputBufferL = data; break; case ICOMP_AUDIO_OUTPUTL: plugin->AudioOutputBufferL = data; break; case ICOMP_AUDIO_INPUTR: plugin->AudioInputBufferR = data; break; case ICOMP_AUDIO_OUTPUTR: plugin->AudioOutputBufferR = data; break; case ICOMP_METER_INL: plugin->MeterInputL = data; break; case ICOMP_METER_INR: plugin->MeterInputR = data; break; case ICOMP_METER_OUTL: plugin->MeterOutputL = data; break; case ICOMP_METER_OUTR: plugin->MeterOutputR = data; break; case ICOMP_METER_DRIVE: plugin->MeterDrive = data; break; } } static void activateIComp(LV2_Handle instance) { IComp *plugin = (IComp *)instance; plugin->Envelope=0; plugin->Rms=0; /* default values */ plugin->LastBypass = 0.0; plugin->LastRms = 0.5; plugin->LastAttack = 0.015; plugin->LastRelease = 0.050; plugin->LastThresh = 0.0; plugin->LastRatio = 1.0; plugin->LastGain = 0.0; plugin->LastNoClip = 1.0; plugin->EnvInLLast = 0.0; plugin->EnvOutLLast = 0.0; plugin->EnvInRLast = 0.0; plugin->EnvOutRLast = 0.0; plugin->EnvDriveLast = 0.0; plugin->ConvertedBypass =convertParam(ICOMP_BYPASS, plugin->LastBypass, plugin->SampleRate); plugin->ConvertedRms =convertParam(ICOMP_RMS, plugin->LastRms, plugin->SampleRate); plugin->ConvertedAttack =convertParam(ICOMP_ATTACK, plugin->LastAttack, plugin->SampleRate); plugin->ConvertedRelease=convertParam(ICOMP_RELEASE, plugin->LastRelease, plugin->SampleRate); plugin->ConvertedThresh =convertParam(ICOMP_THRESH, plugin->LastThresh, plugin->SampleRate); plugin->ConvertedRatio =convertParam(ICOMP_RATIO, plugin->LastRatio, plugin->SampleRate); plugin->ConvertedGain =convertParam(ICOMP_GAIN, plugin->LastGain, plugin->SampleRate); plugin->ConvertedNoClip =convertParam(ICOMP_NOCLIP, plugin->LastNoClip, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); } static void runMonoIComp(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioOutputL; float OutL,EnvInL,EnvOutL,EnvDrive; float fAudioL,fEnvelope,fRms,fRmsSize; float fBypass,fAttack,fRelease,fThresh,fRatio,fGain,fCompGain,fNoClip; double fRmsDelta,fAttackDelta,fReleaseDelta,fThreshDelta,fRatioDelta,fGainDelta; int HasDelta; float drive=0; unsigned long lSampleIndex; IComp *plugin = (IComp *)instance; pParamFunc = &convertParam; /* see if any params have changed */ checkParamChange(ICOMP_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(ICOMP_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fRmsDelta = getParamChange(ICOMP_RMS, plugin->ControlRms, &(plugin->LastRms), &(plugin->ConvertedRms), plugin->SampleRate, pParamFunc); fAttackDelta = getParamChange(ICOMP_ATTACK, plugin->ControlAttack, &(plugin->LastAttack), &(plugin->ConvertedAttack), plugin->SampleRate, pParamFunc); fReleaseDelta = getParamChange(ICOMP_RELEASE,plugin->ControlRelease,&(plugin->LastRelease),&(plugin->ConvertedRelease),plugin->SampleRate, pParamFunc); fThreshDelta = getParamChange(ICOMP_THRESH, plugin->ControlThresh, &(plugin->LastThresh), &(plugin->ConvertedThresh), plugin->SampleRate, pParamFunc); fRatioDelta = getParamChange(ICOMP_RATIO, plugin->ControlRatio, &(plugin->LastRatio), &(plugin->ConvertedRatio), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(ICOMP_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fRmsDelta == 0 && fAttackDelta==0 && fReleaseDelta==0 && fThreshDelta==0 && fRatioDelta==0 && fGainDelta==0 ) { HasDelta=0; fRmsSize = plugin->ConvertedRms; fAttack = plugin->ConvertedAttack; fRelease = plugin->ConvertedRelease; fThresh = plugin->ConvertedThresh; fRatio = plugin->ConvertedRatio; fGain = plugin->ConvertedGain; } else { HasDelta=1; fRmsSize = plugin->ConvertedRms - fRmsDelta; fAttack = plugin->ConvertedAttack - fAttackDelta; fRelease = plugin->ConvertedRelease - fReleaseDelta; fThresh = plugin->ConvertedThresh - fThreshDelta; fRatio = plugin->ConvertedRatio - fRatioDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fRmsDelta = fRmsDelta/(float)SampleCount; fAttackDelta = fAttackDelta/(float)SampleCount; fReleaseDelta = fReleaseDelta/(float)SampleCount; fThreshDelta = fThreshDelta/(float)SampleCount; fRatioDelta = fRatioDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } fEnvelope = plugin->Envelope; fRms = plugin->Rms; fCompGain = 1; // this is set before it is used unless we are given no samples in which case it doesn't matter EnvInL = plugin->EnvInLLast; EnvOutL = plugin->EnvOutLLast; EnvDrive = plugin->EnvDriveLast; pfAudioInputL = plugin->AudioInputBufferL; pfAudioOutputL = plugin->AudioOutputBufferL; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { fAudioL=*(pfAudioInputL++); // work out the rms fRms = sqrt(( (fRmsSize-1)*fRms*fRms + fAudioL*fAudioL ) / fRmsSize); // work out the envelope fEnvelope += (fRms > fEnvelope) ? fAttack * (fRms - fEnvelope) : fRelease * (fRms - fEnvelope); // work out the gain fCompGain = (fEnvelope > fThresh) ? (pow((fEnvelope/fThresh), ((1.0/fRatio)-1.0) )) : 1; OutL= fNoClip > 0 ? InoClip(fAudioL*fCompGain * fGain,&drive ) : fAudioL*fCompGain * fGain ; *(pfAudioOutputL++) =OutL; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioL, EnvInL); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fRmsSize += fRmsDelta; fAttack += fAttackDelta; fRelease += fReleaseDelta; fThresh += fThreshDelta; fRatio += fRatioDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); } //zero everything fRms = 0.0; fEnvelope = 0.0; fCompGain = 1.0; EnvInL = 0.0; EnvOutL = 0.0; EnvDrive = 0.0; } // remember for next time round plugin->Envelope = (fabs(fEnvelope)<1.0e-10) ? 0.f : fEnvelope; plugin->Rms = (fabs(fRms)<1.0e-10) ? 0.f : fRms; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterDrive)=EnvDrive; // 0.015848932=-36dB (the max gain reduction this compressor can do) *(plugin->ControlMeter)=(fCompGain > 0.015848932) ? 20*log10(fCompGain) : -36.0; } static void runStereoIComp(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float fAudioL,fAudioR,fMaxAudio,fEnvelope,fRms,fRmsSize; float fBypass,fAttack,fRelease,fThresh,fRatio,fGain,fCompGain,fNoClip; double fRmsDelta,fAttackDelta,fReleaseDelta,fThreshDelta,fRatioDelta,fGainDelta; int HasDelta; float OutL,EnvInL,EnvOutL; float OutR,EnvInR,EnvOutR; float drive,EnvDrive; float driveL=0; float driveR=0; unsigned long lSampleIndex; IComp *plugin = (IComp *)instance; pParamFunc = &convertParam; /* see if any params have changed */ checkParamChange(ICOMP_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); checkParamChange(ICOMP_NOCLIP, plugin->ControlNoClip, &(plugin->LastNoClip), &(plugin->ConvertedNoClip), plugin->SampleRate, pParamFunc); fRmsDelta = getParamChange(ICOMP_RMS, plugin->ControlRms, &(plugin->LastRms), &(plugin->ConvertedRms), plugin->SampleRate, pParamFunc); fAttackDelta = getParamChange(ICOMP_ATTACK, plugin->ControlAttack, &(plugin->LastAttack), &(plugin->ConvertedAttack), plugin->SampleRate, pParamFunc); fReleaseDelta = getParamChange(ICOMP_RELEASE,plugin->ControlRelease,&(plugin->LastRelease),&(plugin->ConvertedRelease),plugin->SampleRate, pParamFunc); fThreshDelta = getParamChange(ICOMP_THRESH, plugin->ControlThresh, &(plugin->LastThresh), &(plugin->ConvertedThresh), plugin->SampleRate, pParamFunc); fRatioDelta = getParamChange(ICOMP_RATIO, plugin->ControlRatio, &(plugin->LastRatio), &(plugin->ConvertedRatio), plugin->SampleRate, pParamFunc); fGainDelta = getParamChange(ICOMP_GAIN, plugin->ControlGain, &(plugin->LastGain), &(plugin->ConvertedGain), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; fNoClip = plugin->ConvertedNoClip; if(fRmsDelta == 0 && fAttackDelta==0 && fReleaseDelta==0 && fThreshDelta==0 && fRatioDelta==0 && fGainDelta==0 ) { HasDelta=0; fRmsSize = plugin->ConvertedRms; fAttack = plugin->ConvertedAttack; fRelease = plugin->ConvertedRelease; fThresh = plugin->ConvertedThresh; fRatio = plugin->ConvertedRatio; fGain = plugin->ConvertedGain; } else { HasDelta=1; fRmsSize = plugin->ConvertedRms - fRmsDelta; fAttack = plugin->ConvertedAttack - fAttackDelta; fRelease = plugin->ConvertedRelease - fReleaseDelta; fThresh = plugin->ConvertedThresh - fThreshDelta; fRatio = plugin->ConvertedRatio - fRatioDelta; fGain = plugin->ConvertedGain - fGainDelta; if(SampleCount > 0) { /* these are the incements to use in the run loop */ fRmsDelta = fRmsDelta/(float)SampleCount; fAttackDelta = fAttackDelta/(float)SampleCount; fReleaseDelta = fReleaseDelta/(float)SampleCount; fThreshDelta = fThreshDelta/(float)SampleCount; fRatioDelta = fRatioDelta/(float)SampleCount; fGainDelta = fGainDelta/(float)SampleCount; } } fEnvelope = plugin->Envelope; fRms = plugin->Rms; fCompGain = 1; // this is set before it is used unless we are given no samples in which case it doesn't matter EnvInL = plugin->EnvInLLast; EnvInR = plugin->EnvInRLast; EnvOutL = plugin->EnvOutLLast; EnvOutR = plugin->EnvOutRLast; EnvDrive = plugin->EnvDriveLast; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { fAudioL=*(pfAudioInputL++); fAudioR=*(pfAudioInputR++); // work out the rms fMaxAudio = fabs(fAudioL) > fabs(fAudioR) ? fAudioL : fAudioR; fRms = sqrt(( (fRmsSize-1)*fRms*fRms + fMaxAudio*fMaxAudio ) / fRmsSize); // work out the envelope fEnvelope += (fRms > fEnvelope) ? fAttack * (fRms - fEnvelope) : fRelease * (fRms - fEnvelope); // work out the gain fCompGain = (fEnvelope > fThresh) ? (pow((fEnvelope/fThresh), ((1.0/fRatio)-1.0))) : 1; OutL = fNoClip > 0 ? InoClip(fAudioL*fCompGain*fGain,&driveL) : fAudioL*fCompGain*fGain ; OutR = fNoClip > 0 ? InoClip(fAudioR*fCompGain*fGain,&driveR) : fAudioR*fCompGain*fGain ; *(pfAudioOutputL++) = OutL ; *(pfAudioOutputR++) = OutR ; //evelope on in and out for meters EnvInL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioL, EnvInL); EnvInR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], fAudioR, EnvInR); EnvOutL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutL, EnvOutL); EnvOutR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], OutR, EnvOutR); drive = driveL > driveR ? driveL : driveR; EnvDrive += applyIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], drive, EnvDrive); //update any changing parameters if(HasDelta==1) { fRmsSize += fRmsDelta; fAttack += fAttackDelta; fRelease += fReleaseDelta; fThresh += fThreshDelta; fRatio += fRatioDelta; fGain += fGainDelta; } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //zero everything fRms = 0.0; fEnvelope = 0.0; fCompGain = 1.0; EnvInL = 0.0; EnvInR = 0.0; EnvOutL = 0.0; EnvOutR = 0.0; EnvDrive = 0.0; } // remember for next time round plugin->Envelope = (fabs(fEnvelope)<1.0e-10) ? 0.f : fEnvelope; plugin->Rms = (fabs(fRms)<1.0e-10) ? 0.f : fRms; plugin->EnvInLLast = (fabs(EnvInL)<1.0e-10) ? 0.f : EnvInL; plugin->EnvInRLast = (fabs(EnvInR)<1.0e-10) ? 0.f : EnvInR; plugin->EnvOutLLast = (fabs(EnvOutL)<1.0e-10) ? 0.f : EnvOutL; plugin->EnvOutRLast = (fabs(EnvOutR)<1.0e-10) ? 0.f : EnvOutR; plugin->EnvDriveLast = (fabs(EnvDrive)<1.0e-10) ? 0.f : EnvDrive; // update the meters *(plugin->MeterInputL) =(EnvInL > 0.001) ? 20*log10(EnvInL) : -90.0; *(plugin->MeterInputR) =(EnvInR > 0.001) ? 20*log10(EnvInR) : -90.0; *(plugin->MeterOutputL)=(EnvOutL > 0.001) ? 20*log10(EnvOutL) : -90.0; *(plugin->MeterOutputR)=(EnvOutR > 0.001) ? 20*log10(EnvOutR) : -90.0; *(plugin->MeterDrive)=EnvDrive; // 0.015848932=-36dB (the max gain reduction this compressor can do) *(plugin->ControlMeter)=(fCompGain > 0.015848932) ? 20*log10(fCompGain) : -36.0; } static void cleanupIComp(LV2_Handle instance) { free(instance); } static void init() { ICompMonoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); ICompMonoDescriptor->URI = ICOMP_MONO_URI; ICompMonoDescriptor->activate = activateIComp; ICompMonoDescriptor->cleanup = cleanupIComp; ICompMonoDescriptor->connect_port = connectPortIComp; ICompMonoDescriptor->deactivate = NULL; ICompMonoDescriptor->instantiate = instantiateIComp; ICompMonoDescriptor->run = runMonoIComp; ICompMonoDescriptor->extension_data = NULL; ICompStereoDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); ICompStereoDescriptor->URI = ICOMP_STEREO_URI; ICompStereoDescriptor->activate = activateIComp; ICompStereoDescriptor->cleanup = cleanupIComp; ICompStereoDescriptor->connect_port = connectPortIComp; ICompStereoDescriptor->deactivate = NULL; ICompStereoDescriptor->instantiate = instantiateIComp; ICompStereoDescriptor->run = runStereoIComp; ICompStereoDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!ICompMonoDescriptor) init(); switch (index) { case 0: return ICompMonoDescriptor; case 1: return ICompStereoDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { /* some conversion formulae are shared so the bounds are the min/max across all ports */ float result; switch(param) { case ICOMP_RMS: if(value<0) result= 1; else if (value < 1) result= (pow(value,3) * (float)sr/20)+1; else result= ((float)sr/20)+1; break; case ICOMP_ATTACK: if(value<0.00001) result= 1 - pow(10, -301.0301 / ((float)sr * 0.01)); else if (value <0.750) result= 1 - pow(10, -301.0301 / ((float)sr * value*1000.0)); else result= 1 - pow(10, -301.0301 / ((float)sr * 750.0)); break; case ICOMP_RELEASE: if(value<0.001) result= 1 - pow(10, -301.0301 / ((float)sr * 1)); else if (value <5) result= 1 - pow(10, -301.0301 / ((float)sr * value*1000.0)); else result= 1 - pow(10, -301.0301 / ((float)sr * 5000.0)); break; case ICOMP_THRESH: case ICOMP_RATIO: case ICOMP_GAIN: if(value<-36) result= pow(10, -1.8); else if (value < 36) result= pow(10, value/20.0); else result= pow(10, 1.8); break; case ICOMP_NOCLIP: case ICOMP_BYPASS: if(value<=0.0) result= 0; else result= 1; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/inv_compressor.h0000664000175000017500000000316711251515772023057 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ICOMP_GUI_URI "http://invadarecords.com/plugins/lv2/compressor/gui" #define ICOMP_MONO_URI "http://invadarecords.com/plugins/lv2/compressor/mono" #define ICOMP_STEREO_URI "http://invadarecords.com/plugins/lv2/compressor/stereo" #define ICOMP_BYPASS 0 #define ICOMP_RMS 1 #define ICOMP_ATTACK 2 #define ICOMP_RELEASE 3 #define ICOMP_THRESH 4 #define ICOMP_RATIO 5 #define ICOMP_GAIN 6 #define ICOMP_NOCLIP 7 #define ICOMP_METER_GR 8 #define ICOMP_METER_DRIVE 9 #define ICOMP_METER_INL 10 #define ICOMP_METER_OUTL 11 #define ICOMP_AUDIO_INPUTL 12 #define ICOMP_AUDIO_OUTPUTL 13 #define ICOMP_METER_INR 14 /* not used in mono mode */ #define ICOMP_METER_OUTR 15 /* not used in mono mode */ #define ICOMP_AUDIO_INPUTR 16 /* not used in mono mode */ #define ICOMP_AUDIO_OUTPUTR 17 /* not used in mono mode */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_meter.h0000664000175000017500000000423211251515772021771 0ustar alessioalessio/* (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IMETER_URI "http://invadarecords.com/plugins/lv2/meter"; #define IMETER_GUI_URI "http://invadarecords.com/plugins/lv2/meter/gui"; #define IMETER_BYPASS 0 #define IMETER_AUDIO_INL 1 #define IMETER_AUDIO_INR 2 #define IMETER_AUDIO_OUTL 3 #define IMETER_AUDIO_OUTR 4 #define IMETER_METER_L 5 #define IMETER_METER_R 6 #define IMETER_VU_L 7 #define IMETER_VU_R 8 #define IMETER_METER_PHASE 9 #define IMETER_SPEC_20 10 #define IMETER_SPEC_25 11 #define IMETER_SPEC_31 12 #define IMETER_SPEC_40 13 #define IMETER_SPEC_50 14 #define IMETER_SPEC_63 15 #define IMETER_SPEC_80 16 #define IMETER_SPEC_100 17 #define IMETER_SPEC_125 18 #define IMETER_SPEC_160 19 #define IMETER_SPEC_200 20 #define IMETER_SPEC_250 21 #define IMETER_SPEC_315 22 #define IMETER_SPEC_400 23 #define IMETER_SPEC_500 24 #define IMETER_SPEC_630 25 #define IMETER_SPEC_800 26 #define IMETER_SPEC_1000 27 #define IMETER_SPEC_1250 28 #define IMETER_SPEC_1600 29 #define IMETER_SPEC_2000 30 #define IMETER_SPEC_2500 31 #define IMETER_SPEC_3150 32 #define IMETER_SPEC_4000 33 #define IMETER_SPEC_5000 34 #define IMETER_SPEC_6300 35 #define IMETER_SPEC_8000 36 #define IMETER_SPEC_10000 37 #define IMETER_SPEC_12500 38 #define IMETER_SPEC_16000 39 #define IMETER_SPEC_20000 40 #define FILTER_COUNT 31 /* control conversion function */ float convertParam(unsigned long param, float value, double sr); invada-studio-plugins-lv2-1.2.0/plugin/inv_meter.c0000664000175000017500000002640611251515772021773 0ustar alessioalessio/* This LV2 plugin provides meters (c) Fraser Stuart 2009 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "library/common.h" #include "inv_meter.h" static LV2_Descriptor *IMeterDescriptor = NULL; typedef struct { /* Ports */ float *ControlBypass; float *AudioInputBufferL; float *AudioInputBufferR; float *AudioOutputBufferL; float *AudioOutputBufferR; float *MeterL; float *MeterR; float *VuL; float *VuR; float *MeterPhase; float *Spec[FILTER_COUNT]; /* stuff we need to remember to reduce cpu */ double SampleRate; /* stuff we need to remember to reduce cpu */ float LastBypass; float ConvertedBypass; struct Envelope EnvAD[4]; float EnvMeterLLast; float EnvMeterRLast; float EnvVuLLast; float EnvVuRLast; float EnvPhaseLast; float EnvSpecLast[FILTER_COUNT]; /* filters */ struct FilterP * filters; } IMeter; static LV2_Handle instantiateIMeter(const LV2_Descriptor *descriptor, double s_rate, const char *path, const LV2_Feature * const* features) { IMeter *plugin = (IMeter *)malloc(sizeof(IMeter)); if(plugin==NULL) return NULL; /* set some initial params */ plugin->SampleRate=s_rate; /* the delays */ if((plugin->filters = (struct FilterP *)malloc(sizeof(struct FilterP) * FILTER_COUNT))==NULL) return NULL; return (LV2_Handle)plugin; } static void connectPortIMeter(LV2_Handle instance, uint32_t port, void *data) { IMeter *plugin = (IMeter *)instance; switch (port) { case IMETER_BYPASS: plugin->ControlBypass = data; break; case IMETER_AUDIO_INL: plugin->AudioInputBufferL = data; break; case IMETER_AUDIO_INR: plugin->AudioInputBufferR = data; break; case IMETER_AUDIO_OUTL: plugin->AudioOutputBufferL = data; break; case IMETER_AUDIO_OUTR: plugin->AudioOutputBufferR = data; break; case IMETER_METER_L: plugin->MeterL = data; break; case IMETER_METER_R: plugin->MeterR = data; break; case IMETER_VU_L: plugin->VuL = data; break; case IMETER_VU_R: plugin->VuR = data; break; case IMETER_METER_PHASE: plugin->MeterPhase = data; break; case IMETER_SPEC_20: case IMETER_SPEC_25: case IMETER_SPEC_31: case IMETER_SPEC_40: case IMETER_SPEC_50: case IMETER_SPEC_63: case IMETER_SPEC_80: case IMETER_SPEC_100: case IMETER_SPEC_125: case IMETER_SPEC_160: case IMETER_SPEC_200: case IMETER_SPEC_250: case IMETER_SPEC_315: case IMETER_SPEC_400: case IMETER_SPEC_500: case IMETER_SPEC_630: case IMETER_SPEC_800: case IMETER_SPEC_1000: case IMETER_SPEC_1250: case IMETER_SPEC_1600: case IMETER_SPEC_2000: case IMETER_SPEC_2500: case IMETER_SPEC_3150: case IMETER_SPEC_4000: case IMETER_SPEC_5000: case IMETER_SPEC_6300: case IMETER_SPEC_8000: case IMETER_SPEC_10000: case IMETER_SPEC_12500: case IMETER_SPEC_16000: case IMETER_SPEC_20000: plugin->Spec[port-10] = data; break; } } static void activateIMeter(LV2_Handle instance) { IMeter *plugin = (IMeter *)instance; int i; //defaults plugin->LastBypass = 0; plugin->EnvMeterLLast = 0; plugin->EnvMeterRLast = 0; plugin->EnvVuLLast = 0; plugin->EnvVuRLast = 0; plugin->EnvPhaseLast = 0; for(i=0;iEnvSpecLast[i] = 0; } plugin->ConvertedBypass = convertParam(IMETER_BYPASS, plugin->LastBypass, plugin->SampleRate); /* initialise envelopes */ initIEnvelope(&plugin->EnvAD[INVADA_METER_VU], INVADA_METER_VU, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], INVADA_METER_PEAK, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], INVADA_METER_PHASE, plugin->SampleRate); initIEnvelope(&plugin->EnvAD[INVADA_METER_LAMP], INVADA_METER_LAMP, plugin->SampleRate); /* initialise filters */ initBandpassFilter(&plugin->filters[0], plugin->SampleRate, 20.0, 0.33); initBandpassFilter(&plugin->filters[1], plugin->SampleRate, 25.0, 0.33); initBandpassFilter(&plugin->filters[2], plugin->SampleRate, 31.5, 0.33); initBandpassFilter(&plugin->filters[3], plugin->SampleRate, 40.0, 0.33); initBandpassFilter(&plugin->filters[4], plugin->SampleRate, 50.0, 0.33); initBandpassFilter(&plugin->filters[5], plugin->SampleRate, 63.0, 0.33); initBandpassFilter(&plugin->filters[6], plugin->SampleRate, 80.0, 0.33); initBandpassFilter(&plugin->filters[7], plugin->SampleRate, 100.0, 0.33); initBandpassFilter(&plugin->filters[8], plugin->SampleRate, 125.0, 0.33); initBandpassFilter(&plugin->filters[9], plugin->SampleRate, 160.0, 0.33); initBandpassFilter(&plugin->filters[10], plugin->SampleRate, 200.0, 0.33); initBandpassFilter(&plugin->filters[11], plugin->SampleRate, 250.0, 0.33); initBandpassFilter(&plugin->filters[12], plugin->SampleRate, 315.0, 0.33); initBandpassFilter(&plugin->filters[13], plugin->SampleRate, 400.0, 0.33); initBandpassFilter(&plugin->filters[14], plugin->SampleRate, 500.0, 0.33); initBandpassFilter(&plugin->filters[15], plugin->SampleRate, 630.0, 0.33); initBandpassFilter(&plugin->filters[16], plugin->SampleRate, 800.0, 0.33); initBandpassFilter(&plugin->filters[17], plugin->SampleRate, 1000.0, 0.33); initBandpassFilter(&plugin->filters[18], plugin->SampleRate, 1250.0, 0.33); initBandpassFilter(&plugin->filters[19], plugin->SampleRate, 1600.0, 0.33); initBandpassFilter(&plugin->filters[20], plugin->SampleRate, 2000.0, 0.33); initBandpassFilter(&plugin->filters[21], plugin->SampleRate, 2500.0, 0.33); initBandpassFilter(&plugin->filters[22], plugin->SampleRate, 3150.0, 0.33); initBandpassFilter(&plugin->filters[23], plugin->SampleRate, 4000.0, 0.33); initBandpassFilter(&plugin->filters[24], plugin->SampleRate, 5000.0, 0.33); initBandpassFilter(&plugin->filters[25], plugin->SampleRate, 6300.0, 0.33); initBandpassFilter(&plugin->filters[26], plugin->SampleRate, 8000.0, 0.33); initBandpassFilter(&plugin->filters[27], plugin->SampleRate, 10000.0, 0.33); initBandpassFilter(&plugin->filters[28], plugin->SampleRate, 12500.0, 0.33); initBandpassFilter(&plugin->filters[29], plugin->SampleRate, 16000.0, 0.33); initBandpassFilter(&plugin->filters[30], plugin->SampleRate, 20000.0, 0.33); } static void runIMeter(LV2_Handle instance, uint32_t SampleCount) { float (*pParamFunc)(unsigned long, float, double) = NULL; float * pfAudioInputL; float * pfAudioInputR; float * pfAudioOutputL; float * pfAudioOutputR; float fBypass; float In; float InL,EnvMeterL,EnvVuL; float InR,EnvMeterR,EnvVuR; float EnvPhase,CurrentPhase; float EnvSpec[FILTER_COUNT]; int i; struct FilterP *filter; uint32_t lSampleIndex; IMeter *plugin = (IMeter *)instance; pParamFunc = &convertParam; checkParamChange(IMETER_BYPASS, plugin->ControlBypass, &(plugin->LastBypass), &(plugin->ConvertedBypass), plugin->SampleRate, pParamFunc); fBypass = plugin->ConvertedBypass; pfAudioInputL = plugin->AudioInputBufferL; pfAudioInputR = plugin->AudioInputBufferR; pfAudioOutputL = plugin->AudioOutputBufferL; pfAudioOutputR = plugin->AudioOutputBufferR; EnvMeterL = plugin->EnvMeterLLast; EnvMeterR = plugin->EnvMeterRLast; EnvVuL = plugin->EnvVuLLast; EnvVuR = plugin->EnvVuRLast; EnvPhase = plugin->EnvPhaseLast; for(i=0;iEnvSpecLast[i]; } if(fBypass==0) { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { InL=*(pfAudioInputL++); InR=*(pfAudioInputR++); In=(InL+InR)/2; *(pfAudioOutputL++) = InL; *(pfAudioOutputR++) = InR; //evelope on in and out for meters EnvMeterL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InL, EnvMeterL); EnvMeterR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PEAK], InR, EnvMeterR); EnvVuL += applyIEnvelope(&plugin->EnvAD[INVADA_METER_VU], InL, EnvVuL); EnvVuR += applyIEnvelope(&plugin->EnvAD[INVADA_METER_VU], InR, EnvVuR); //envelope for phase if(fabs(InL) > 0.001 || fabs(InR) > 0.001) { // -60 db CurrentPhase = fabs(InL+InR) > 0.000001 ? atan(fabs((InL-InR)/(InL+InR))) : PI_ON_2; } else { CurrentPhase =0; } EnvPhase += applyIEnvelope(&plugin->EnvAD[INVADA_METER_PHASE], CurrentPhase, EnvPhase); //envelop for spectrum filter=plugin->filters; for(i=0;iEnvAD[INVADA_METER_PEAK], applyBandpassFilter(&filter[i],In), EnvSpec[i]); } } } else { for (lSampleIndex = 0; lSampleIndex < SampleCount; lSampleIndex++) { *(pfAudioOutputL++) = *(pfAudioInputL++); *(pfAudioOutputR++) = *(pfAudioInputR++); } //evelope on in and out for meters EnvMeterL =0; EnvMeterR =0; EnvVuL =0; EnvVuR =0; EnvPhase =0; for(i=0;iEnvMeterLLast = (fabs(EnvMeterL)<1.0e-10) ? 0.f : EnvMeterL; plugin->EnvMeterRLast = (fabs(EnvMeterR)<1.0e-10) ? 0.f : EnvMeterR; plugin->EnvVuLLast = (fabs(EnvVuL)<1.0e-10) ? 0.f : EnvVuL; plugin->EnvVuRLast = (fabs(EnvVuR)<1.0e-10) ? 0.f : EnvVuR; plugin->EnvPhaseLast = (fabs(EnvPhase)<1.0e-10) ? 0.f : EnvPhase; for(i=0;iEnvSpecLast[i] = (fabs(EnvSpec[i])<1.0e-10) ? 0.f : EnvSpec[i]; } // update the meters *(plugin->MeterL) = (EnvMeterL > 0.001) ? 20*log10(EnvMeterL) : -90.0; *(plugin->MeterR) = (EnvMeterR > 0.001) ? 20*log10(EnvMeterR) : -90.0; *(plugin->VuL) = EnvVuL; *(plugin->VuR) = EnvVuR; *(plugin->MeterPhase) = EnvPhase; for(i=0;iSpec[i]) = (EnvSpec[i] > 0.001) ? 20*log10(EnvSpec[i]) : -90.0; } } static void cleanupIMeter(LV2_Handle instance) { free(instance); } static void init() { IMeterDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); IMeterDescriptor->URI = IMETER_URI; IMeterDescriptor->activate = activateIMeter; IMeterDescriptor->cleanup = cleanupIMeter; IMeterDescriptor->connect_port = connectPortIMeter; IMeterDescriptor->deactivate = NULL; IMeterDescriptor->instantiate = instantiateIMeter; IMeterDescriptor->run = runIMeter; IMeterDescriptor->extension_data = NULL; } LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor(uint32_t index) { if (!IMeterDescriptor) init(); switch (index) { case 0: return IMeterDescriptor; default: return NULL; } } /*****************************************************************************/ float convertParam(unsigned long param, float value, double sr) { float result; switch(param) { case IMETER_BYPASS: if(value<=0.0) result= 0; else result= 1; break; default: result=0; break; } return result; } invada-studio-plugins-lv2-1.2.0/plugin/Makefile0000664000175000017500000000374311251515772021276 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # GENERAL CC = gcc LD = gcc CFLAGS = -I. -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC LDFLAGS = -shared -Llibrary -lc -lm -linv_common -fPIC -DPIC PLUGINS = inv_compressor.so \ inv_delay.so \ inv_erreverb.so \ inv_filter.so \ inv_input.so \ inv_meter.so \ inv_phaser.so \ inv_testtone.so \ inv_tube.so \ all: $(PLUGINS) # RULES TO BUILD PLUGINS FROM C CODE inv_compressor.so: inv_compressor.o inv_compressor.h inv_delay.so: inv_delay.o inv_delay.h inv_erreverb.so: inv_erreverb.o inv_erreverb.h inv_filter.so: inv_filter.o inv_filter.h inv_input.so: inv_input.o inv_input.h inv_meter.so: inv_meter.o inv_meter.h inv_phaser.so: inv_phaser.o inv_phaser.h inv_testtone.so: inv_testtone.o inv_testtone.h inv_tube.so: inv_tube.o inv_tube.h # OTHER TARGETS targets: $(PLUGINS) always: clean: -rm -f *.so -rm -f *.o -rm -f *~ %.o: %.c @echo "Compiling $<" @$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ %.so: %.o @echo "Creating $@" @$(LD) -o $@ $< $(LDFLAGS) invada-studio-plugins-lv2-1.2.0/CREDITS0000664000175000017500000000130211251515772017345 0ustar alessioalessioThe author would like to thank the following people for their help, support, comments, suggestions, patches etc. Denise Faulkner - for putting up with me :) Thorsten Wilms, Steve Harris, Dave Robillard - for the LV2 spec, without which this wouldn't be possible. Nedko Arnaudov, Dave Robillard, Philipp Überbacher - for being another pair of eyes (or is that ears?). Damon Chaplin - for discovering some uninitialised varaiables and providing a patch. Philipp Überbacher - 'DESTDIR' patch. Dave Robillard - Port Groups patch. Big thanks to the people making the host applications - without which this software would be useless: Ardour [http://ardour.org] lv2Rack [http://home.gna.org/zynjacku/] invada-studio-plugins-lv2-1.2.0/Makefile0000664000175000017500000000730011251515772017771 0ustar alessioalessio# Copyright (C) 2009 Fraser Stuart # # 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # ##################################################################### # PLEASE CHANGE THIS to your preferred installation location! # # Change this if you want to install somewhere else. INSTALL_SYS_PLUGINS_DIR = /usr/local/lib/lv2 INSTALL_USER_PLUGINS_DIR = ~/.lv2 INSTALL_BUNDLE_DIR = invada.lv2 # NO EDITING below this line is required # if all you want to do is install and use the plugins. ##################################################################### # GENERAL SUBDIRS = plugin/library plugin plugingui/widgets plugingui GLADEDIRS = plugingui/gtk DESTDIR = "" all: @for i in $(SUBDIRS); do \ echo ""; \ echo "=================================="; \ echo "make all in $$i"; \ echo "=================================="; \ (cd $$i; $(MAKE) ); done @echo "" glade: @for i in $(GLADEDIRS); do \ echo ""; \ echo "=================================="; \ echo "make all in $$i"; \ echo "=================================="; \ (cd $$i; $(MAKE) ); done @echo "" # OTHER TARGETS install: @echo "" @echo "use 'make install-user' to install in $(INSTALL_USER_PLUGINS_DIR) or 'make install-sys' to install in $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)" @echo "" install-sys: @echo "" @echo "=================================="; @echo "Installing into $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)"; @echo "=================================="; -mkdir -p $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) -mkdir -p $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk cp plugin/*.so $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp plugingui/*.so $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp rdf/*.ttl $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp plugingui/gtk/*.png $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk cp plugingui/gtk/*.xml $(DESTDIR)$(INSTALL_SYS_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk @echo "" install-user: @echo "" @echo "=================================="; @echo "Installing into $(INSTALL_USER_PLUGINS_DIR)"; @echo "=================================="; -mkdir -p $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) -mkdir -p $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk cp plugin/*.so $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp plugingui/*.so $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp rdf/*.ttl $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR) cp plugingui/gtk/*.png $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk cp plugingui/gtk/*.xml $(INSTALL_USER_PLUGINS_DIR)/$(INSTALL_BUNDLE_DIR)/gtk @echo "" always: clean: @echo "" -rm -f `find . -name "*.so"` -rm -f `find . -name "*.a"` -rm -f `find . -name "*.o"` -rm -f `find . -name "*~"` @echo "" veryclean: @echo "" -rm -f `find . -name "*.so"` -rm -f `find . -name "*.a"` -rm -f `find . -name "*.o"` -rm -f `find . -name "*.xml"` -rm -f `find . -name "*~"` @echo ""