/g/ - Technology

install openbsd

[Make a Post]
[X]





Simple album playlist based music player Nanonymous No.1029 [D][U][F][S][L][A][C] >>1033 >>1157
File: 8a69f467df2c92282c0e965375d68e048c84104c5fcc24f43ef3a39df8c83144.jpg (dl) (5.46 MiB)

Hey faggots, I just made this to replace cmus with something simple and more UNIXy. Roast me.
https://repo.or.cz/mus.git

Nanonymous No.1033 [D] >>1034

>>1029
>written entirely in shell scripts, making it unusable for everyone except you
>requires (((GNU))) make even though the only thing it does is copy some files around
>doesn't follow the POSIX standard
I like your text formatting though. Way better than echoing all the control characters manually every time you print stuff.

Nanonymous No.1034 [D] >>1035

>>1033
>written entirely in shell scripts, making it unusable for everyone except you
What?
>requires (((GNU))) make even though the only thing it does is copy some files around
It doesn't needs GNU, though, only Linux. If your system doesn't have a simple wrapper for POSIX syscalls like flock, just write it yourself.
As for inotify, it's just the only sane to do it, especially since POSIX sleep can't sleep less than 1 second.
>doesn't follow the POSIX standard
It does. Needing additional tools isn't the same as using stuff like read -0 or other GNU only stuff.

Honestly, the point of using sh is that you can modify it (thus port it) easily.

Nanonymous No.1035 [D]

>>1034
Whoops, I said bullshit, flock isn't POSIX. Well, how would you read/write atomically without?

Nanonymous No.1039 [D]

It now works on the BSDs. Illumos won't get this since it doesn't have flock at all.

Nanonymous No.1142 [D]

>MOTW
>spheres
>cynic
>ved buens ende
>racer x
>at the gates
>my dying bride
bretty gud

Nanonymous No.1157 [D] >>1158

>>1029
>using a dedicated muzaks player
>not dumping all your muzaks into one folder and symlinking each one into a tagged folder
this is the true unix way tbh

Nanonymous No.1158 [D] >>1159

>>1157
yes, and it sucks dick

Nanonymous No.1159 [D][U][F]
File: 0bf27c682f12ff6ebc2e004c9f193cf47b29c07cef8a49a6fba1775b0406695f.png (dl) (487.18 KiB)

>>1158
>unsubstantiated opinion
status: discarded

Nanonymous No.1160 [D] >>1164 >>1206

how do you view all the albums made in 1999? like this?
by_date/1999/album1
by_date/1999/album2

how do you order songs within an album?
like this?
artist1/album1/01_first_song
artist1/album1/02_second_song

va/album1/01_first_song
does not tell you who the artist is. lots of albums have a different artist for each track

what if you want to look up a specific album but don't remember the arist? the above format wont work. you'll have to do a search through the entire filesystem

what if you want to look through albums by genre? how do you get a list of album/artists in a specific genre? i want a list like:
spiral architect - a spectic's universe
megadeth - rust in peace

how do you even refer to a file from the command line? what if it has metacharacters? what if it changes your terminal's character set? what character encoding are you using in your filenames? seriously, renaming a bunch of retarded filenames from some downloaded music sucks ass. it can have all kinds of shit that prevents you from easily copying the name and pasting it (and you can't type it because it's using all kinds of characters from different languages and control and invisible characters). whats the size limit of your filenames or paths?

then you have to deal with all the retarded shit to make file operations atomic in your OS, then deal with even more bullshit when making this portable

and stuff i plan to add in my system (which is actually like your UNIX way shit but instead of everything-is-a-file idiocy, we have everything-is-value):
playlists are just a list of values of dynamic type, so they can be audio, some specific region within an audio file (which itself is a value that just refers to the audio file and has a start position and length), videos, 3d models, images, tables of text, integers, integers with repeating decimal notation, or anything else you can imagine. in practice your music playlists would then just contain albums, songs, and portions of songs, which is already more powerful than what most UNIX crap (i.e all software ever made, including Windows software, because Windows is the exact same shit as UNIX but slightly worse) can do. oh yeah and albums and audio "files" (values) in this system can be referenced by a hash which can be used to build a decentralized system like last.fm which refers to audio files by hash instead of strings of text, and that hash can be used by anyone to instantly download the file themselves, melting the line between mentioning a song and pirating it.

Nanonymous No.1164 [D]

>>1160
Literally just use a single sqlite database.
CREATE TABLE Metadata (Filename, Attribute, Value);
INSERT INTO Metadata VALUES ('thing.mp3', 'artist', 'Ur mom');
INSERT INTO Metadata VALUES ('thing.mp3', 'title', 'Fart noises');
INSERT INTO Metadata VALUES ('blah.ogg', 'title', 'Hitler speeches');
then you go:
SELECT Filename FROM Metadata WHERE Title = 'Hitler speeches';
and you get blah.ogg.
There are other (probably better) ways to organize the database, of course.

Nanonymous No.1165 [D]

yes that works too. anything is better than muh UNIX way

Nanonymous No.1206 [D] >>1207

>>1160
>how do you view all the albums made in 1999? like this?
>by_date/1999/album1
>by_date/1999/album2
$ printf '%s\n' ~/Music/*/\(1999\)*
or
$ printf '%s\n' ~/Music/*/* | grep '/(1999)[^/]*$'

>how do you order songs within an album?
>like this?
>artist1/album1/01_first_song
>artist1/album1/02_second_song
Yes

>va/album1/01_first_song
>does not tell you who the artist is. lots of albums have a different artist for each track
$ ls /Music/Initial D/(1998) 1st Stage ~D Selection 1~/01. Dave Rodgers - Space Boy.flac
I have no need for this kind of metadata, though, so the tags are used to do it robustly.

>what if you want to look up a specific album but don't remember the arist? the above format wont work. you'll have to do a search through the entire filesystem
m8, learn the UNIX tools, grep/sed/awk are sufficient for this.

>what if you want to look through albums by genre? how do you get a list of album/artists in a specific genre? i want a list like:
>spiral architect - a spectic's universe
>megadeth - rust in peace
I don't sort by genres, but I would just do Music/Genre/Artist/...

>how do you even refer to a file from the command line? what if it has metacharacters? what if it changes your terminal's character set?
find -print0 is here to handle all this shit.
>what character encoding are you using in your filenames?
UTF-8
>seriously, renaming a bunch of retarded filenames from some downloaded music sucks ass. it can have all kinds of shit that prevents you from easily copying the name and pasting it (and you can't type it because it's using all kinds of characters from different languages and control and invisible characters).
I have a script to do it, and I mainly download flac from rutracker which is tagged correctly.
>whats the size limit of your filenames or paths?
Come on, I've never encountered a problem with this.

>then you have to deal with all the retarded shit to make file operations atomic in your OS, then deal with even more bullshit when making this portable
That's the cost of having a playlist that you can edit like a normal text file.


I'm rewriting the whole shit in C with libflac and libao, currently.

Nanonymous No.1207 [D] >>1213

>>1206
>I'm rewriting the whole shit in C with libflac and libao, currently.
Based. Make sure to post here when you're finished. I'm sure the code will be beautiful with your level of autism.

Nanonymous No.1213 [D]

>>1207
It will. The only reason I wanted to depart from sh is that UNIX sockets > FIFOs for IPC and I want threads to avoid the spaghetti of having a process for the server-side IPC that needs to do IPC with the server itself.
And I'll have gapless playback, which I also find important.

Nanonymous No.1946 [D][U][F] >>1947
File: 12ba169b3cdae5a663791f2ba70a77aa531a682b65e2ae264ae635c5ce644450.jpg (dl) (247.17 KiB)

It's now finished. At least for my personal use, I lack nothing now.

Nanonymous No.1947 [D] >>1948 >>1953

>>1946
Well done anon, at least you get something done... I'm constantly procrastinating on my own project(s).
Screenshot?

Nanonymous No.1948 [D][U][F] >>1952
File: 693ce2113906468082d613c815b42b246eed3fec496cbe5279c0d10438e8df67.png (dl) (381.43 KiB)

>>1947
Well, the only interface is a lemonbar script, so pic related I guess.

Nanonymous No.1952 [D]

>>1948
Pretty neat.

Nanonymous No.1953 [D]

>>1947
I always program in bursts; and I'm sure it's the same for every imageboard dweller.
Since I just finished my master (thank god, goodbye uni pinkos), I'm searching work while "NEETing" so I would have no excuses for not doing anything.

Nanonymous No.2083 [D]

You've contributed. That is enough. Thank you.