Skip to content

Commit 79dd43c

Browse files
committed
1.0: separate code and docs
1 parent 746bb70 commit 79dd43c

File tree

17 files changed

+431
-406
lines changed

17 files changed

+431
-406
lines changed

Makefile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
PROJECT=vinyldc
12
CC=gcc
2-
CFLAGS=-c -Wall -lSDL2 -lSDL2_image -lm -g
3-
LDFLAGS=-lSDL2 -lSDL2_image -lm -g
4-
SOURCES=main.c wav.c vinyl.c point.c surface.c
3+
CFLAGS=-c -Wall -Isrc -g
4+
LDFLAGS=-lSDL2 -lSDL2_image -lm
5+
SOURCES=src/main.c src/wav.c src/vinyl.c src/point.c src/surface.c
56
OBJECTS=$(SOURCES:.c=.o)
6-
EXECUTABLE=vinyldc
7+
RM=rm -f
78

8-
all: $(SOURCES) $(EXECUTABLE)
9-
10-
$(EXECUTABLE): $(OBJECTS)
11-
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
9+
all: $(PROJECT)
1210

13-
.c.o:
11+
$(PROJECT): $(OBJECTS)
12+
$(CC) $^ $(LDFLAGS) -o $@
13+
14+
%.o: %.c
1415
$(CC) $(CFLAGS) $< -o $@
1516

1617
clean:
17-
rm -f $(OBJECTS) $(EXECUTABLE)
18+
$(RM) $(OBJECTS) $(PROJECT)

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# vinyldc
2+
13
Description
24
===========
35
My go at the interesting Samsung interview task I have found on the internet recently
@@ -14,10 +16,12 @@ Compillation and running
1416

1517
1. install libsdl2 dependencies:
1618
`apt-get install libsdl2-dev libsdl2-image-dev`
17-
2. compile and run:
18-
`make && ./vinyldc vinyl.png`
19-
3. play decoded file (command line vlc player is used in this example):
20-
`cvlc vinyl_decoded.wav`
19+
2. compile:
20+
`make`
21+
3. run:
22+
`./vinyldc vinyl.png vinyl.wav`
23+
4. play decoded file (command line vlc player is used in this example):
24+
`cvlc vinyl.wav`
2125

2226
Algorithm description
2327
=====================
@@ -36,4 +40,3 @@ Algorithm description
3640
3. encountered a very dark bump on the track and the algoritm considered it to be 'off track' value. Add the value
3741
to the sample file as if it was light enough
3842
4. After we have reached the end of the plate, prepend the wav header with the amount of samples we have written to the beginning of the sample file.
39-

main.c

Lines changed: 0 additions & 229 deletions
This file was deleted.

point.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)