Skip to content

Commit

Permalink
1.0: separate code and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Nov 10, 2023
1 parent 746bb70 commit 79dd43c
Show file tree
Hide file tree
Showing 17 changed files with 431 additions and 406 deletions.
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
PROJECT=vinyldc
CC=gcc
CFLAGS=-c -Wall -lSDL2 -lSDL2_image -lm -g
LDFLAGS=-lSDL2 -lSDL2_image -lm -g
SOURCES=main.c wav.c vinyl.c point.c surface.c
CFLAGS=-c -Wall -Isrc -g
LDFLAGS=-lSDL2 -lSDL2_image -lm
SOURCES=src/main.c src/wav.c src/vinyl.c src/point.c src/surface.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=vinyldc
RM=rm -f

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
all: $(PROJECT)

.c.o:
$(PROJECT): $(OBJECTS)
$(CC) $^ $(LDFLAGS) -o $@

%.o: %.c
$(CC) $(CFLAGS) $< -o $@

clean:
rm -f $(OBJECTS) $(EXECUTABLE)
$(RM) $(OBJECTS) $(PROJECT)
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# vinyldc

Description
===========
My go at the interesting Samsung interview task I have found on the internet recently
Expand All @@ -14,10 +16,12 @@ Compillation and running

1. install libsdl2 dependencies:
`apt-get install libsdl2-dev libsdl2-image-dev`
2. compile and run:
`make && ./vinyldc vinyl.png`
3. play decoded file (command line vlc player is used in this example):
`cvlc vinyl_decoded.wav`
2. compile:
`make`
3. run:
`./vinyldc vinyl.png vinyl.wav`
4. play decoded file (command line vlc player is used in this example):
`cvlc vinyl.wav`

Algorithm description
=====================
Expand All @@ -36,4 +40,3 @@ Algorithm description
3. encountered a very dark bump on the track and the algoritm considered it to be 'off track' value. Add the value
to the sample file as if it was light enough
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.

229 changes: 0 additions & 229 deletions main.c

This file was deleted.

25 changes: 0 additions & 25 deletions point.c

This file was deleted.

Loading

0 comments on commit 79dd43c

Please sign in to comment.