package main

import (
	"fmt"
	// "log"
	"os"
	"sync"
)

var config Config

func main() {

	config.load()
	fmt.Printf("%+v\n", config)

	var waitGroup sync.WaitGroup
	waitGroup.Add(1)
	slideshowDir := make(chan string)
	go server(slideshowDir)
	go slideshow(slideshowDir)

	var dir string
	args := os.Args[1:]
	if len(args) > 0 {
		dir = args[0]
	} else {
		dir = ""
	}
	slideshowDir <- dir

	waitGroup.Wait()
}
