There was an inevitability about East Ayrshire Council proposing to close New Cumnock pool in 2016. “The older generation didn’t go near it, it was just kids,” says Mary Clapperton.

Mary remembers what it was like for visitors to the only freshwater open air pool in Scotland. She worked there until 1999 when the council made 50 per cent of the two remaining staff redundant.

“The curtains would stick to you when you were changing. There was only one toilet, a hole in the floor,” the 59 year old recalls. She doesn’t mean a continental-style public loo. There was an actual hole in the floor.

Three years ago things were bleak in New Cumnock. Since the decline of coal mining, the town’s population had shrunk from a high of 9,000 to around 2,000. Three years earlier it had been given a “carbuncle” when Urban Realm magazine dubbed it Scotland’s most dismal town. Perhaps the final straw was the announcement that the Town Hall too would be closed. But the locals had one last play to make.

They appealed to the Duke of Rothesay, Prince Charles. In the summer of 2007 he had bought nearby Dumfries House for £45 million and spent five years restoring it, opening the house itself, with its near-priceless collection of Chippendale Furniture to the public, and turning the grounds into an engine of regeneration.

It is a remarkable project. Dumfries House offers training, education, artistic and health resources, for free, to those who can benefit. That includes craftspeople looking to learn traditional skills such as thatching, stone masonry and pargeting (ornamental lime plasterwork). It includes inspiring primary school children in science and engineering. Or giving people with diabetes the confidence to prepare healthier food.

People like 33 year old Graeme Bone, of Auchinlea who took a college qualification in textiles and after a course at Dumfries House and now works upcycling factory offcuts to make bags and other items for sale at premium prices. Of those who do the course he did, 90 per cent find work. “It’s hard not to be inspired here,” he says.

There is Gemma Kennedy, 21, also of Auchinleck, who got a weekend job in the cafe while still at school. She still works there, but also caters weddings and official dinners when the Prince is in residence. As well as gaining experience, she’s stacked up additional qualifications and learned how to cater formal occasions. “There aren’t a lot of jobs on offer in East Ayrshire,” she says. “When Dumfries Houses started up it was an excellent opportunity for young people.”

Kris Muir, 27, came as an unemployed painter and decorator on a Prince’s Trust joinery course four years ago, but now the single dad has is a qualified head gardener. He tends the five acre arboretum, recently planted with 500 native species of tree. “This got me off the sofa,” he says. “I used to think a plant was just a plant,” Now he knows the Latin names of 120 plants. “This place has lifted New Cumnock, “ he adds. “The hotels have started to fill up, and with fancier customers. One of them has had to be upgraded.”

Traditional building skills are an known enthusiasm of the current owner, but they are in demand, according to Michael Goodger, built environment education manager. “There are six million traditional buildings in the UK, most of which work on fundamentally different principles to modern day construction,” he says. People living in traditional tenements make this mistake, he adds. “Modern gypsum doesn’t control moisture in the same way as lime plaster. Doing modern things to old buildings can have catastrophic effects.”

Now the Prince’s project has extended beyond the bounds of the Dumfries House estate for the first time with the refurbishment of the Town Hall and pool in New Cumnock. There is a new sense of optimism amid the faded bunting and boarded up shops. ‘Lido tourists’ come from as far away as London while locals of all ages flock to open air aquarobics and summer night-swimming sessions.

Mary, back now as duty officer, makes sure they are looked after (elderly spectators are liable to be offered a hot water bottle). What Prince Charles has done for the town has been “amazing”, she says.

“Once you swim in outdoor pool you will always swim in an outdoor pool. You can’t beat it,” she adds.