Commit Graph

22 Commits

Author SHA1 Message Date
676e95023e Draw the interface with TeamSpeak icon packs
Icon packs are read in TeamSpeak's own format — a zip (or unpacked folder)
of SVG/PNG art plus a settings.ini mapping icon keys to files — so the packs
of an installed client and the ones from its add-on site work unchanged.
Legacy packs without that mapping (default.zip) are resolved by their file
naming convention instead, picking the resolution closest to the drawn size.

The pack draws the tree, toolbar, menus, context menus, file browser and the
default group icons; a pack's FALLBACK option decides whether what it lacks
comes from default.zip, and anything still missing falls back to the icons
the client draws itself. Options → Design picks the pack and shows a viewer
of everything in it.

Vector art is rasterised with JSVG, and the pack search roots are shared
with the sound packs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 12:46:39 +00:00
e1f62ab50d Stop notification sounds queueing behind buffered silence
The mixer wrote silence between sounds to keep the line running, which left
the playback buffer (400 ms on the PipeWire ring) full of it, so a sound the
user had just triggered only started once all of that had drained. Wait for
the next sound instead, leaving the buffer empty between them.

Opening the line costs a device round-trip of its own, so hold it for 30 s of
quiet rather than dropping it after 3 s and paying that on the next action.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 11:56:27 +00:00
2d7b82f9a3 Play sound-pack notifications for client actions
Adds TeamSpeak-format sound packs: a folder of waves plus a settings.ini
mapping actions to play()/say() entries, with ${clientType} and friends
resolved per event. Packs are found in the client's own sound folder, an
installed TS3 client and a folder of the user's choosing, so the official
packs work unchanged.

Each action can be switched off or marked important; important actions are
the only ones still played while the speakers are muted, as in TS3. The new
Notifications options page lists them by category, greys out what the active
pack has no sound for, and previews on double-click.

Sounds are decoded, resampled and mixed onto a single playback line that is
only open while something plays, so overlapping events never fight over the
device.

Fires the events from the protocol layer, following TeamSpeak's own
distinctions: reason ids separate switched/moved/kicked/banned/timed out,
and visibility decides appears/disappears/stays.

Also fixes a ts3j trap in the process: a field an event never carried reads
back as an empty string, so the existing "e.get(x) != null" checks were
always true. That made a partial clientupdate (someone muting) announce a
stopped recording, and it let a nickname-only update reset another client's
mute/away flags and talk power, or a channel edit blank the channel name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 11:53:11 +00:00
23896456ee Stop the channel list from clearing channel icons
The channellist command answers with a narrower field set than the events
the server pushes while connecting, so reconciling against it wiped the
icon ids those events had just delivered — leaving pre-existing channel
icons invisible while a live icon change still showed up. Treat a missing
or blank icon there as "not reported" rather than "no icon"; only the edit
event, which lists exactly what changed, may clear one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 07:42:14 +00:00
f334153e63 Repaint the whole tree viewport while scrolling
The right-aligned icon strip is positioned against the viewport rather than
the row, so the pixels a blit scroll reuses are stale and the icons leave
ghosts behind. Scroll the viewport in simple mode, and widen every repaint
request to the full visible width so a row whose label changes size cannot
leave its icons behind either.

Also stop blacklisting an icon whose download failed only because the file
transfer channel was not up yet: channel rows are painted during connect,
well before that point, so their icons would never be retried.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 07:28:09 +00:00
610dce1bd9 Show each channel's own icon in the tree
Channels carry a channel_icon_id just like groups do; track it on
ChannelNode from the channel list and the create/edit events, and paint it
in the same right-aligned strip that already carries a client's group
icons. Spacers keep their bare look.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 07:09:21 +00:00
7c86a1f166 Show server and channel group icons in the tree
Download the icons a server advertises for its groups over the file
transfer channel, cache them under the config directory, and draw them as
a badge strip on each client's row, right-aligned against the tree's
visible edge like the TeamSpeak client does. Groups without a custom icon
fall back to the bundled default set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 07:06:23 +00:00
0333b92ce5 Add a PipeWire audio backend and stereo capture/playback
Capture and playback now go through AudioCapture/AudioPlayback interfaces
with two implementations: PipeWire, used for the system default and for
every pw: device when a session is reachable, and Java Sound for the raw
ALSA devices and other platforms. The PipeWire binding is FFM-based
(PipeWireLibrary, PipeWireSession, PipeWireStream, SpaPod) and enumerates
the graph's real devices, so each stream shows up separately in volume
mixers.

Lines are opened with a negotiated channel count instead of a fixed mono
format: OPUS_MUSIC transmits the stereo capture as-is, OPUS_VOICE keeps
transmitting the mono downmix so the pre-processing chain and VAD still
see a single channel. Java Sound enumeration asks only for "a mixer that
can capture/play" so the PipeWire and PulseAudio ALSA plugins are no
longer hidden by their narrow format lists.

The Java Sound classes are renamed to Desktop* to match what they now
are, and JUnit plus a SpaPod round-trip test are wired into the build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 05:30:46 +00:00
d5018729d8 Slim the shaded jar from 7.3 MB down to 2.0 MB
Three things bloated it. Nothing tree-shook the dependencies, so all of
bcprov shipped even though only its lightweight API (AES-EAX, ECDSA over
prime256v1, ASN.1, EC point math) is ever touched. Its multi-release
copies under META-INF/versions accounted for another 2.3 MB that could
never even load, since the shaded jar is not itself multi-release.
And ts3j dragged in commons-lang and dnsjava for one call each.

Enable minimizeJar, keeping our own modules and ts3j whole (they are the
entry points, and ts3j instantiates packet bodies reflectively), and drop
the versioned entries. The shade plugin has to move to 3.6.2 for this:
3.5.1 bundles an ASM that cannot read class file major version 70.

The remaining large entry is the bundled Windows Opus DLL, at 612 KB.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:47:03 +00:00
9d63522ef2 Replace JNA with the FFM API (Panama) for the Opus binding
Bind libopus through java.lang.foreign downcall handles instead of JNA:
the ctl functions are linked with firstVariadicArg(2), and the encoder and
decoder each own a shared Arena holding the handle plus reusable native
PCM/packet buffers, so the hot path only allocates the returned packet.

The library is resolved by system SONAME first, falling back to a bundled
copy extracted from the JAR. Only the Windows x86-64 build is packaged by
default now (-Dnatives.all restores all platforms), since every other
platform ships libopus through its package manager.

Requires Java 26.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:35:57 +00:00
022aef633b Drag and drop clients and channels in the server tree
Clients can be dragged into a channel and channels re-parented or
reordered, with an insertion line (or a row outline, for "into this
channel") showing where the drop lands.

Channel positions come from channel_order, which is the id of the
channel above rather than an index, so siblings are now ordered by
walking that chain and the neighbour links are repaired locally on
create, move and delete -- the server only announces the channel
that changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 17:42:49 +00:00
1249242c89 Switch server tabs with the scroll wheel
Wheel events on the tab strip step through the open connections,
clamped at the ends. The content area is excluded so the tree and chat
keep their own scrolling.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 15:28:20 +00:00
41bf9506e3 Use a real tab strip for servers instead of a button bar
ServerTabPane replaces ServerTabBar: the views live in a JTabbedPane
whose strip sits under the toolbar, with the native tab shapes and the
same look as the chat tabs. Each tab carries its server name, the
microphone marker and a close glyph. With a single connection the
server view is mounted directly, so the strip appears only once a
second server is open.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 15:23:25 +00:00
03c6ea9a3b Tabbed servers: multiple simultaneous connections
Each connection now lives in its own ServerTab with its own tree, info
and chat views plus its own mic-mute, deafen, away and commander state.
MainFrame keeps only the shell (menus, toolbar, status bar) and shows
one tab at a time; the tab bar below the toolbar appears once a second
server is open.

Incoming voice from every connection mixes into the same output — each
connection already renders one line per speaker. Capture is exclusive:
a connection only opens the microphone while it holds it, and a toolbar
button moves it to the visible tab. The mic follows a disconnect to
another connected tab, and push-to-talk drives whoever holds it.

Startup bookmarks are no longer mutually exclusive: every flagged
bookmark opens its own tab.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 15:18:47 +00:00
5db3f4d8c4 Two-column bookmark manager with connect-on-startup
Replace the modal add/edit form with a master/detail dialog: bookmark
list on the left, the selected bookmark's settings on the right. Edits
are flushed back into the bookmark when the selection changes or the
dialog closes.

Bookmarks gain a "connect on startup" flag (only one at a time, since
the client holds a single connection); MainFrame connects to it once
the window is up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 15:02:13 +00:00
707d9ebbba Tabbed chats with BBCode rendering and clickable identities
Replace the chat target dropdown with a tab strip along the bottom of the
chat panel: a Server and a Channel tab plus one closable tab per private
chat, each with its own log and an unread marker.

Render logs and channel/client descriptions as HTML through a new BBCode
renderer in core, supporting b/i/u/s, color, size, url, center and lists,
with auto-linked bare URLs. Input is escaped and tag values validated, so
server-supplied text cannot inject markup or unsafe schemes.

Sender names and TeamSpeak's own client:// links open the same context menu
as the server tree (menus extracted into ClientMenu/ChannelMenu); channel://
links open the channel menu. Links are styled by CSS class: identities bold
in the author colour, other TS protocols plain, and links leaving the client
underlined so they cannot be mistaken for an identity.

Dragging a client or channel out of the tree yields the TS3 link BBCode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 13:50:04 +00:00
a69b7bde74 Add default channel to bookmarks
Bookmarks can store a channel to join on connect, given either as a
"/"-separated path or a channel id, plus an optional channel password.
"Add bookmark" offers to remember the channel you are currently in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 13:49:54 +00:00
17ad6cde1c Add identity management
Manage several TeamSpeak identities like the official client instead of
using one auto-generated identity file.

- IdentityStore/IdentityEntry keep each identity as a TeamSpeak-format INI
  in ~/.ts3jclient/identities, so files interchange with the TS3 client;
  supports create, import, export, rename, remove and a cancellable
  security-level search. A legacy identity.ini is migrated in on first load.
- Settings hold the default identity; bookmarks may pin their own, falling
  back to the default when unset.
- TeamspeakConnection now connects with the identity it is handed.
- Swing: Tools -> Identities manager, plus an identity drop-down in the
  connect and bookmark forms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 07:42:08 +00:00
f912cab07b Implement channel file transfers
Add file up/downloads and directory operations for channel file
repositories, reachable from a channel's right-click "Browse files".

Core (com.ts3client.net.filetransfer):
- FileTransferManager drives the TS3 file protocol on the ts3j socket.
  ftinitupload/ftinitdownload results arrive out-of-band as
  notifystartupload/notifystartdownload (success) or
  notifystatusfiletransfer (failure) events, not as command responses,
  so negotiation correlates them by clientftfid via a CompletableFuture.
  The byte phase opens a raw TCP socket, sends the ftkey, then streams.
- FileTransfer: observable per-transfer handle (state, progress, cancel).
- RemoteFile: UI-facing listing DTO, keeping core free of ts3j API types.

TeamspeakConnection exposes list/mkdir/delete/rename and up/download and
manages the manager's lifecycle. Swing FileBrowserDialog provides the
browser UI with a live per-transfer progress strip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 07:22:33 +00:00
9ef3cd4ab3 Bundle libopus natives for a self-contained JAR
Vendor libopus binaries under the desktop module's resources at JNA's
platform resource paths (linux-x86-64/libopus.so, win32-x86-64/opus.dll,
etc.), sourced from the checksum-verified club.minnced:opus-java-natives
1.1.1 artifact with the Windows lib renamed to JNA's mapped name.

Native.load("opus") still prefers a system libopus but now falls back to
the bundled copy, so the shaded uber-JAR runs with no external Opus
install on Linux (x86-64/x86/aarch64/arm), Windows (x86-64/x86) and
Intel macOS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-12 22:58:26 +00:00
80467f5bc0 Merge META-INF/services in shaded uber-JAR
Add ServicesResourceTransformer so overlapping service-provider files
(e.g. java.security.Provider) are concatenated rather than clobbered,
future-proofing the single executable JAR build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-12 22:24:46 +00:00
0f76258a05 Initial commit: TS3J TeamSpeak 3 Java client
Swing desktop client (core/desktop/swing Maven modules) built on the
ts3j protocol library, included as a submodule. Native Opus voice with
voice-activation detection, push-to-talk, and audio pre-processing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-12 22:01:17 +00:00