Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

41
LINES

< > BotCompany Repo | #1020410 // List Recording Programs [Linux, Pulse Audio, dev.]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4884L/27K).

!7

srecord RecordingProgram(
  S processID,
  S applicationName,
  S sourceName,
  int sourceIndex,
  int index
) {}

cmodule ListRecordingPrograms > DynObjectTable<RecordingProgram> {
  start {
    set fieldsInOrder;
    dontPersist();
    doEvery(0.0, 10.0, r updateList);
  }
  
  void updateList enter {
    LS parts = withoutEmptyAfterTrims(splitByZeroIndent(backtick("pactl list source-outputs")));
    new L<RecordingProgram> list;
    
    for (S part : parts) {
      int idx = parseFirstInt(part);
      SS properties1 = parseColonProperties(part);
      SS properties2 = parseEqualsProperties(part);
      int sourceIndex = parseIntOrMinus1(properties1.get("Source"));
      S sourceName = cast dm_findAndCallModule("#1020375/ListAudioSources", 'getSourceName, sourceIndex);
      list.add(nu(RecordingProgram,
        index := idx,
        applicationName := unquote(properties2.get("application.name")),
        processID := unquote(properties2.get("application.process.id")),
        +sourceIndex, +sourceName));
    }
    setData(list);
  }
  
  visualize {
    JComponent c = super.visualize();
    ret centerAndEastWithMargins(c, vstackWithSpacing(jlabel("Buttons go here")));
  }
}

Author comment

Began life as a copy of #1020375

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1020410
Snippet name: List Recording Programs [Linux, Pulse Audio, dev.]
Eternal ID of this version: #1020410/14
Text MD5: d987b9aca2adf82d317d0ff989ac4e39
Transpilation MD5: 6140e96b0c9f0800b615eaaa96cd2057
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-17 13:27:06
Source code size: 1240 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 360 / 12979
Version history: 13 change(s)
Referenced in: [show references]